From 792b3efa62bf7c876cba8a6c376057923ce175fa Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 16 Feb 2010 12:00:24 +0000 Subject: [PATCH] * file.c (rb_group_member): renamed from group_member. don't use group_member() in glibc because it's not valgrind clean. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570047 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ configure.in | 2 +- file.c | 16 +++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 271159226c..81c789ef2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 16 20:56:39 2010 Tanaka Akira + + * file.c (rb_group_member): renamed from group_member. + don't use group_member() in glibc because it's not valgrind clean. + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570047 + Tue Feb 16 19:19:21 2010 Nobuyoshi Nakada * ext/dl/cfunc.c (rb_dlcfunc_call): convert signed value to diff --git a/configure.in b/configure.in index d65f4818d9..513898d3c7 100644 --- a/configure.in +++ b/configure.in @@ -1114,7 +1114,7 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot getcwd eacce setitimer setruid seteuid setreuid setresuid setproctitle socketpair\ setrgid setegid setregid setresgid issetugid pause lchown lchmod\ getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\ - getpriority getrlimit setrlimit sysconf group_member\ + getpriority getrlimit setrlimit sysconf \ dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp snprintf\ setsid telldir seekdir fchmod cosh sinh tanh log2 round signbit\ setuid setgid daemon select_large_fdset setenv unsetenv\ diff --git a/file.c b/file.c index e89a3cd864..36b0b0646e 100644 --- a/file.c +++ b/file.c @@ -921,9 +921,8 @@ rb_file_lstat(VALUE obj) #endif } -#ifndef HAVE_GROUP_MEMBER static int -group_member(GETGROUPS_T gid) +rb_group_member(GETGROUPS_T gid) { #ifndef _WIN32 if (getgid() == gid || getegid() == gid) @@ -950,7 +949,6 @@ group_member(GETGROUPS_T gid) #endif return FALSE; } -#endif #ifndef S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) @@ -987,7 +985,7 @@ eaccess(const char *path, int mode) if (st.st_uid == euid) /* owner */ mode <<= 6; - else if (group_member(st.st_gid)) + else if (rb_group_member(st.st_gid)) mode <<= 3; if ((int)(st.st_mode & mode) == mode) return 0; @@ -1487,7 +1485,7 @@ rb_file_grpowned_p(VALUE obj, VALUE fname) struct stat st; if (rb_stat(fname, &st) < 0) return Qfalse; - if (group_member(st.st_gid)) return Qtrue; + if (rb_group_member(st.st_gid)) return Qtrue; #endif return Qfalse; } @@ -4275,7 +4273,7 @@ static VALUE rb_stat_grpowned(VALUE obj) { #ifndef _WIN32 - if (group_member(get_stat(obj)->st_gid)) return Qtrue; + if (rb_group_member(get_stat(obj)->st_gid)) return Qtrue; #endif return Qfalse; } @@ -4337,7 +4335,7 @@ rb_stat_R(VALUE obj) return st->st_mode & S_IRUSR ? Qtrue : Qfalse; #endif #ifdef S_IRGRP - if (group_member(get_stat(obj)->st_gid)) + if (rb_group_member(get_stat(obj)->st_gid)) return st->st_mode & S_IRGRP ? Qtrue : Qfalse; #endif #ifdef S_IROTH @@ -4429,7 +4427,7 @@ rb_stat_W(VALUE obj) return st->st_mode & S_IWUSR ? Qtrue : Qfalse; #endif #ifdef S_IWGRP - if (group_member(get_stat(obj)->st_gid)) + if (rb_group_member(get_stat(obj)->st_gid)) return st->st_mode & S_IWGRP ? Qtrue : Qfalse; #endif #ifdef S_IWOTH @@ -4524,7 +4522,7 @@ rb_stat_X(VALUE obj) return st->st_mode & S_IXUSR ? Qtrue : Qfalse; #endif #ifdef S_IXGRP - if (group_member(get_stat(obj)->st_gid)) + if (rb_group_member(get_stat(obj)->st_gid)) return st->st_mode & S_IXGRP ? Qtrue : Qfalse; #endif #ifdef S_IXOTH