]> granicus.if.org Git - shadow/commitdiff
* src/su.c: Cleanup local variables.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 13 Jun 2011 18:26:36 +0000 (18:26 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 13 Jun 2011 18:26:36 +0000 (18:26 +0000)
ChangeLog
src/su.c

index 1871ff096731dfa358c429f5d65f28a7270f3cfa..42380db2ab2f65542f97ae4b5dc2869b510f1e05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
        authenticated user. Remove usage of the pwent variable.
        * src/su.c: The password of the caller is the one from the
        spwd structure only if the passwd's password is 'x'.
+       * src/su.c: Cleanup local variables.
 
 2011-06-10  Nicolas François  <nicolas.francois@centraliens.net>
 
index 497027fe35621d9eac9e52683b046822be49822e..7d6e37040d963b0557d7b96da30ec8ad74a94522 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -602,12 +602,10 @@ int main (int argc, char **argv)
        bool amroot = false;
        uid_t my_uid;
        struct passwd *pw = NULL;
-       char **envp = environ;
        char *shellstr = NULL;
        char *command = NULL;
 
 #ifdef USE_PAM
-       char **envcp;
        int ret;
 #else                          /* !USE_PAM */
        int err = 0;
@@ -892,6 +890,7 @@ int main (int argc, char **argv)
                        addenv ("XAUTHORITY", cp);
                }
        } else {
+               char **envp = environ;
                while (NULL != *envp) {
                        addenv (*envp, NULL);
                        envp++;
@@ -959,7 +958,7 @@ int main (int argc, char **argv)
 
        if (change_environment) {
                /* update environment with all pam set variables */
-               envcp = pam_getenvlist (pamh);
+               char **envcp = pam_getenvlist (pamh);
                if (NULL != envcp) {
                        while (NULL != *envcp) {
                                addenv (*envcp, NULL);