[Pkg-shadow-commits] r2899 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sun May 10 18:20:41 UTC 2009


Author: nekral-guest
Date: 2009-05-10 18:20:41 +0000 (Sun, 10 May 2009)
New Revision: 2899

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/su.c
Log:
	* src/su.c: Avoid redeclaration of root_pw.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-05-10 17:12:40 UTC (rev 2898)
+++ upstream/trunk/ChangeLog	2009-05-10 18:20:41 UTC (rev 2899)
@@ -1,3 +1,7 @@
+2009-05-10  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* src/su.c: Avoid redeclaration of root_pw.
+
 2009-05-10  NAKANO Takeo  <nakano at webmasters.gr.jp>
 
 	* po/ja.po: Updated Japanese translation.

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2009-05-10 17:12:40 UTC (rev 2898)
+++ upstream/trunk/src/su.c	2009-05-10 18:20:41 UTC (rev 2899)
@@ -460,16 +460,16 @@
 		}
 	}
 	if ('\0' == name[0]) {		/* use default user */
-		struct passwd *root_pw = getpwnam("root");
+		struct passwd *root_pw = getpwnam ("root");
 		if ((NULL != root_pw) && (0 == root_pw->pw_uid)) {
 			(void) strcpy (name, "root");
 		} else {
-			struct passwd *root_pw = getpwuid(0);
+			root_pw = getpwuid (0);
 			if (NULL == root_pw) {
-				SYSLOG((LOG_CRIT, "There is no UID 0 user."));
-				su_failure(tty);
+				SYSLOG ((LOG_CRIT, "There is no UID 0 user."));
+				su_failure (tty);
 			}
-			(void) strcpy(name, root_pw->pw_name);
+			(void) strcpy (name, root_pw->pw_name);
 		}
 	}
 




More information about the Pkg-shadow-commits mailing list