summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-16 12:00:24 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-16 12:00:24 +0000
commit792b3efa62bf7c876cba8a6c376057923ce175fa (patch)
treea92672abd49842590ca13431f06bf8c076923291
parent4d71618c3888f841b3f2242e95f9b2a702807f03 (diff)
* 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
-rw-r--r--ChangeLog6
-rw-r--r--configure.in2
-rw-r--r--file.c16
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 <akr@fsij.org>
+
+ * 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 <nobu@ruby-lang.org>
* 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