From 0b8e85c1f9c6d741e1b8556cc3be6b62c97e7937 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Mon, 9 Feb 2015 12:09:32 -0500 Subject: [PATCH] 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 --- src/log/pagsh.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); -- 2.39.5