diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/socket/option.c | 2 | ||||
-rw-r--r-- | test/socket/test_unix.rb | 2 |
3 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Mon Feb 9 00:37:06 2009 Tanaka Akira <akr@fsij.org> + + * 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@fsij.org> * ext/socket/extconf.rb: check sys/param.h and sys/ucred.h. diff --git a/ext/socket/option.c b/ext/socket/option.c index c79c1f529f..7bffdf8d6b 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -264,7 +264,7 @@ inspect_local_peercred(int level, int optname, VALUE data, VALUE ret) 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="; diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index 6799e52fd1..6b54594736 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -321,7 +321,7 @@ class TestUNIXSocket < Test::Unit::TestCase 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 |