From: Benjamin Kaduk Date: Mon, 9 Feb 2015 17:09:32 +0000 (-0500) Subject: pagsh: do not call set[ug]id() X-Git-Tag: upstream/1.8.0_pre1^2~315 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0b8e85c1f9c6d741e1b8556cc3be6b62c97e7937;p=packages%2Fo%2Fopenafs.git pagsh: do not call set[ug]id() Supposedly calling setuid(getuid()) and setgid(getgid()) would help pick up a new group list on some systems, in the depths of history. In the absence of reason to believe this is still the case, drop the calls to avoid scary warnings about unchecked return values. Change-Id: I39e87a27fb52f5a6868b867c9325d4a5fa93ef58 Reviewed-on: http://gerrit.openafs.org/11759 Tested-by: BuildBot Reviewed-by: Chas Williams <3chas3@gmail.com> Reviewed-by: Jeffrey Altman --- diff --git a/src/log/pagsh.c b/src/log/pagsh.c index 7bbdcfba2..773d6a2df 100644 --- a/src/log/pagsh.c +++ b/src/log/pagsh.c @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) { struct passwd *pwe; - int uid, gid; + int uid; char *shell = "/bin/sh"; #ifdef AFS_AIX32_ENV @@ -49,7 +49,6 @@ main(int argc, char *argv[]) nsa.sa_flags = SA_FULLDUMP; sigaction(SIGSEGV, &nsa, NULL); #endif - gid = getgid(); uid = getuid(); pwe = getpwuid(uid); if (pwe == 0) { @@ -63,8 +62,6 @@ main(int argc, char *argv[]) #ifdef AFS_KERBEROS_ENV ktc_newpag(); #endif - (void)setuid(uid); - (void)setgid(gid); argv[0] = shell; execvp(shell, argv); perror(shell);