1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/option.c (inspect_local_peercred): cr_uid is a effective

uid, not a real uid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-08 15:42:17 +00:00
parent 9e45748143
commit f11d2b55f7
3 changed files with 7 additions and 2 deletions

View file

@ -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.

View file

@ -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=";

View file

@ -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