fix SHELL being set to the usr's home directory

This commit is contained in:
Jakob Kramer 2013-10-18 21:57:24 +02:00 committed by sin
parent bfb4b38cff
commit ab37391837

2
su.c
View File

@ -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);