* src/su.c: Cleanup local variables.

This commit is contained in:
nekral-guest 2011-06-13 18:26:36 +00:00
parent b273c4d19f
commit b661b913b5
2 changed files with 3 additions and 3 deletions

View File

@ -25,6 +25,7 @@
authenticated user. Remove usage of the pwent variable. authenticated user. Remove usage of the pwent variable.
* src/su.c: The password of the caller is the one from the * src/su.c: The password of the caller is the one from the
spwd structure only if the passwd's password is 'x'. 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> 2011-06-10 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -602,12 +602,10 @@ int main (int argc, char **argv)
bool amroot = false; bool amroot = false;
uid_t my_uid; uid_t my_uid;
struct passwd *pw = NULL; struct passwd *pw = NULL;
char **envp = environ;
char *shellstr = NULL; char *shellstr = NULL;
char *command = NULL; char *command = NULL;
#ifdef USE_PAM #ifdef USE_PAM
char **envcp;
int ret; int ret;
#else /* !USE_PAM */ #else /* !USE_PAM */
int err = 0; int err = 0;
@ -892,6 +890,7 @@ int main (int argc, char **argv)
addenv ("XAUTHORITY", cp); addenv ("XAUTHORITY", cp);
} }
} else { } else {
char **envp = environ;
while (NULL != *envp) { while (NULL != *envp) {
addenv (*envp, NULL); addenv (*envp, NULL);
envp++; envp++;
@ -959,7 +958,7 @@ int main (int argc, char **argv)
if (change_environment) { if (change_environment) {
/* update environment with all pam set variables */ /* update environment with all pam set variables */
envcp = pam_getenvlist (pamh); char **envcp = pam_getenvlist (pamh);
if (NULL != envcp) { if (NULL != envcp) {
while (NULL != *envcp) { while (NULL != *envcp) {
addenv (*envcp, NULL); addenv (*envcp, NULL);