]> granicus.if.org Git - shadow/commitdiff
* src/su.c: Avoid redeclaration of root_pw.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 10 May 2009 18:20:41 +0000 (18:20 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 10 May 2009 18:20:41 +0000 (18:20 +0000)
ChangeLog
src/su.c

index 5ba303f7634797ef3fb9e0ea2931bee36f00ad58..dfa99dc745c3632a0ce3f340d5fe4f20665c98ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-10  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/su.c: Avoid redeclaration of root_pw.
+
 2009-05-10  NAKANO Takeo  <nakano@webmasters.gr.jp>
 
        * po/ja.po: Updated Japanese translation.
index a5a4c7c5069e52404de2b714909c069b2e6082a0..57df663a597ed291e77571dbd261e05111f8c948 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -460,16 +460,16 @@ int main (int argc, char **argv)
                }
        }
        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);
                }
        }