diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-11-22 08:37:11 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-11-22 08:37:11 +0000 |
commit | 5dd8f6e20cb982a5598f3f8977d844b17cf2e6b8 (patch) | |
tree | 79c8f89350c30c8f9914bd238b855d9a7163d53f | |
parent | c97ed5ef9a33f40940a2546e5d6cd7f8d34ae878 (diff) | |
download | ruby-5dd8f6e20cb982a5598f3f8977d844b17cf2e6b8.tar.gz |
* file.c (test_grpowned, rb_stat_grpowned): should honor
supplementary group IDs. [ruby-core:09546]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | file.c | 8 |
2 files changed, 9 insertions, 4 deletions
@@ -8,6 +8,11 @@ Wed Nov 22 16:00:49 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * ext/tk/tkutil/extconf.rb: able to be called manually [ruby-talk:225950]. +Wed Nov 15 23:22:54 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (test_grpowned, rb_stat_grpowned): should honor + supplementary group IDs. [ruby-core:09546] + Tue Nov 7 18:35:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (formal_assign): need to pack rest arg information in @@ -789,7 +789,7 @@ static int group_member(GETGROUPS_T gid) { #ifndef _WIN32 - if (getgid() == gid) + if (getgid() == gid || getegid() == gid) return Qtrue; # ifdef HAVE_GETGROUPS @@ -849,7 +849,7 @@ eaccess(const char *path, int mode) if (st.st_uid == euid) /* owner */ mode <<= 6; - else if (getegid() == st.st_gid || group_member(st.st_gid)) + else if (group_member(st.st_gid)) mode <<= 3; if ((st.st_mode & mode) == mode) return 0; @@ -1330,7 +1330,7 @@ test_grpowned(VALUE obj, VALUE fname) struct stat st; if (rb_stat(fname, &st) < 0) return Qfalse; - if (st.st_gid == getegid()) return Qtrue; + if (group_member(st.st_gid)) return Qtrue; #endif return Qfalse; } @@ -3651,7 +3651,7 @@ static VALUE rb_stat_grpowned(VALUE obj) { #ifndef _WIN32 - if (get_stat(obj)->st_gid == getegid()) return Qtrue; + if (group_member(get_stat(obj)->st_gid)) return Qtrue; #endif return Qfalse; } |