ruby-changes:10582
From: akr <ko1@a...>
Date: Mon, 9 Feb 2009 00:42:29 +0900 (JST)
Subject: [ruby-changes:10582] Ruby:r22138 (trunk): * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective
akr 2009-02-09 00:42:17 +0900 (Mon, 09 Feb 2009) New Revision: 22138 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22138 Log: * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective uid, not a real uid. Modified files: trunk/ChangeLog trunk/ext/socket/option.c trunk/test/socket/test_unix.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 22137) +++ ChangeLog (revision 22138) @@ -1,3 +1,8 @@ +Mon Feb 9 00:37:06 2009 Tanaka Akira <akr@f...> + + * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective + uid, not a real uid. + Mon Feb 9 00:30:56 2009 Tanaka Akira <akr@f...> * ext/socket/extconf.rb: check sys/param.h and sys/ucred.h. Index: ext/socket/option.c =================================================================== --- ext/socket/option.c (revision 22137) +++ ext/socket/option.c (revision 22138) @@ -264,7 +264,7 @@ struct xucred cred; memcpy(&cred, RSTRING_PTR(data), sizeof(struct xucred)); rb_str_catf(ret, " version=%u", cred.cr_version); - rb_str_catf(ret, " uid=%u", cred.cr_uid); + rb_str_catf(ret, " euid=%u", cred.cr_uid); if (cred.cr_ngroups) { int i; char *sep = " groups="; Index: test/socket/test_unix.rb =================================================================== --- test/socket/test_unix.rb (revision 22137) +++ test/socket/test_unix.rb (revision 22138) @@ -321,7 +321,7 @@ s, = serv.accept cred = s.getsockopt(0, Socket::LOCAL_PEERCRED) inspect = cred.inspect - assert_match(/ uid=#{Process.uid} /, inspect) + assert_match(/ euid=#{Process.euid} /, inspect) assert_match(/ \(xucred\)/, inspect) } end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/