If we are preserving the environment use SHELL instead of pw->pw_shell
This commit is contained in:
parent
acb9ae197e
commit
bfb4b38cff
3
su.c
3
su.c
@ -112,7 +112,8 @@ main(int argc, char **argv)
|
||||
setenv("LOGNAME", pw->pw_name, 1);
|
||||
}
|
||||
}
|
||||
execve(pw->pw_shell, newargv, environ);
|
||||
execve(pflag ? getenv("SHELL") : pw->pw_shell,
|
||||
newargv, environ);
|
||||
}
|
||||
return (errno == ENOENT) ? 127 : 126;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user