зеркало из https://github.com/github/ruby.git
* process.c (has_privilege): Refine uid/gid check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
82d85fe441
Коммит
192c39532b
|
@ -1,3 +1,7 @@
|
|||
Fri Sep 5 12:57:52 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (has_privilege): Refine uid/gid check.
|
||||
|
||||
Fri Sep 5 12:40:55 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* configure.in: Check sys/id.h, getuidx and getgidx for AIX.
|
||||
|
|
|
@ -3346,7 +3346,7 @@ has_privilege(void)
|
|||
ret = getresuid(&ruid, &euid, &suid);
|
||||
if (ret == -1)
|
||||
rb_sys_fail("getresuid(2)");
|
||||
if (ruid != suid)
|
||||
if (euid != suid)
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
|
@ -3356,7 +3356,7 @@ has_privilege(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (ruid == 0 || ruid != euid)
|
||||
if (euid == 0 || euid != ruid)
|
||||
return 1;
|
||||
|
||||
#ifdef HAVE_GETRESGID
|
||||
|
@ -3366,7 +3366,7 @@ has_privilege(void)
|
|||
ret = getresgid(&rgid, &egid, &sgid);
|
||||
if (ret == -1)
|
||||
rb_sys_fail("getresgid(2)");
|
||||
if (rgid != sgid)
|
||||
if (egid != sgid)
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
@ -3376,7 +3376,7 @@ has_privilege(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (rgid == 0 || rgid != egid)
|
||||
if (egid == 0 || egid != rgid)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче