[Pkg-shadow-commits] r3073 - upstream/trunk/src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Tue Sep 8 21:33:21 UTC 2009


Author: nekral-guest
Date: 2009-09-08 21:33:14 +0000 (Tue, 08 Sep 2009)
New Revision: 3073

Modified:
   upstream/trunk/src/su.c
Log:
pid_child and kill_child are only used when USE_PAM.


Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2009-09-08 21:00:12 UTC (rev 3072)
+++ upstream/trunk/src/su.c	2009-09-08 21:33:14 UTC (rev 3073)
@@ -78,8 +78,6 @@
  * Global variables
  */
 char *Prog;
-/* PID of the child, in case it needs to be killed */
-static pid_t pid_child = 0;
 
 /* not needed by sulog.c anymore */
 static char name[BUFSIZ];
@@ -91,6 +89,8 @@
 #ifdef USE_PAM
 static pam_handle_t *pamh = NULL;
 static bool caught = false;
+/* PID of the child, in case it needs to be killed */
+static pid_t pid_child = 0;
 #endif
 
 extern struct passwd pwent;
@@ -108,8 +108,9 @@
 static void execve_shell (const char *shellstr,
                           char *args[],
                           char *const envp[]);
-static RETSIGTYPE kill_child (int s);
-#ifndef USE_PAM
+#ifdef USE_PAM
+static RETSIGTYPE kill_child (int unused(s));
+#else				/* !USE_PAM */
 static RETSIGTYPE die (int);
 static int iswheel (const char *);
 #endif				/* !USE_PAM */
@@ -148,8 +149,7 @@
 	}
 	return is_on_list (grp->gr_mem, username);
 }
-#endif				/* !USE_PAM */
-
+#else				/* USE_PAM */
 static RETSIGTYPE kill_child (int unused(s))
 {
 	if (0 != pid_child) {
@@ -161,6 +161,7 @@
 	}
 	exit (255);
 }
+#endif				/* USE_PAM */
 
 /* borrowed from GNU sh-utils' "su.c" */
 static bool restricted_shell (const char *shellstr)




More information about the Pkg-shadow-commits mailing list