зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
4d71618c38
Коммит
792b3efa62
|
@ -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
|
||||
|
|
|
@ -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\
|
||||
|
|
16
file.c
16
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче