fix SHELL being set to the usr's home directory
This commit is contained in:
parent
bfb4b38cff
commit
ab37391837
2
su.c
2
su.c
@ -106,7 +106,7 @@ main(int argc, char **argv)
|
|||||||
newargv = (char *const[]){pw->pw_shell, NULL};
|
newargv = (char *const[]){pw->pw_shell, NULL};
|
||||||
if (!pflag) {
|
if (!pflag) {
|
||||||
setenv("HOME", pw->pw_dir, 1);
|
setenv("HOME", pw->pw_dir, 1);
|
||||||
setenv("SHELL", pw->pw_dir, 1);
|
setenv("SHELL", pw->pw_shell, 1);
|
||||||
if (strcmp(pw->pw_name, "root") != 0) {
|
if (strcmp(pw->pw_name, "root") != 0) {
|
||||||
setenv("USER", pw->pw_name, 1);
|
setenv("USER", pw->pw_name, 1);
|
||||||
setenv("LOGNAME", pw->pw_name, 1);
|
setenv("LOGNAME", pw->pw_name, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user