From b661b913b54d59defb904969bcba931e551d17db Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 13 Jun 2011 18:26:36 +0000 Subject: [PATCH] * src/su.c: Cleanup local variables. --- ChangeLog | 1 + src/su.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1871ff09..42380db2 100644 --- 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 diff --git a/src/su.c b/src/su.c index 497027fe..7d6e3704 100644 --- 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);