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:
parent
9e45748143
commit
f11d2b55f7
3 changed files with 7 additions and 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>
|
Mon Feb 9 00:30:56 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.
|
* ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.
|
||||||
|
|
|
@ -264,7 +264,7 @@ inspect_local_peercred(int level, int optname, VALUE data, VALUE ret)
|
||||||
struct xucred cred;
|
struct xucred cred;
|
||||||
memcpy(&cred, RSTRING_PTR(data), sizeof(struct xucred));
|
memcpy(&cred, RSTRING_PTR(data), sizeof(struct xucred));
|
||||||
rb_str_catf(ret, " version=%u", cred.cr_version);
|
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) {
|
if (cred.cr_ngroups) {
|
||||||
int i;
|
int i;
|
||||||
char *sep = " groups=";
|
char *sep = " groups=";
|
||||||
|
|
|
@ -321,7 +321,7 @@ class TestUNIXSocket < Test::Unit::TestCase
|
||||||
s, = serv.accept
|
s, = serv.accept
|
||||||
cred = s.getsockopt(0, Socket::LOCAL_PEERCRED)
|
cred = s.getsockopt(0, Socket::LOCAL_PEERCRED)
|
||||||
inspect = cred.inspect
|
inspect = cred.inspect
|
||||||
assert_match(/ uid=#{Process.uid} /, inspect)
|
assert_match(/ euid=#{Process.euid} /, inspect)
|
||||||
assert_match(/ \(xucred\)/, inspect)
|
assert_match(/ \(xucred\)/, inspect)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue