mirror of git://git.suckless.org/ubase
Set TERM to linux if needed for su and login
This commit is contained in:
parent
8216a97519
commit
916b7fed1e
1
login.c
1
login.c
|
@ -117,6 +117,7 @@ dologin(struct passwd *pw, int preserve)
|
||||||
setenv("SHELL", pw->pw_shell, !preserve);
|
setenv("SHELL", pw->pw_shell, !preserve);
|
||||||
setenv("USER", pw->pw_name, !preserve);
|
setenv("USER", pw->pw_name, !preserve);
|
||||||
setenv("LOGNAME", pw->pw_name, !preserve);
|
setenv("LOGNAME", pw->pw_name, !preserve);
|
||||||
|
setenv("TERM", "linux", !preserve);
|
||||||
setenv("PATH", ENV_PATH, !preserve);
|
setenv("PATH", ENV_PATH, !preserve);
|
||||||
if (chdir(pw->pw_dir) < 0)
|
if (chdir(pw->pw_dir) < 0)
|
||||||
eprintf("chdir %s:", pw->pw_dir);
|
eprintf("chdir %s:", pw->pw_dir);
|
||||||
|
|
2
su.c
2
su.c
|
@ -171,7 +171,7 @@ dologin(struct passwd *pw)
|
||||||
setenv("SHELL", pw->pw_shell, 1);
|
setenv("SHELL", pw->pw_shell, 1);
|
||||||
setenv("USER", pw->pw_name, 1);
|
setenv("USER", pw->pw_name, 1);
|
||||||
setenv("LOGNAME", pw->pw_name, 1);
|
setenv("LOGNAME", pw->pw_name, 1);
|
||||||
setenv("TERM", term ? term : "vt100", 1);
|
setenv("TERM", term ? term : "linux", 1);
|
||||||
if (strcmp(pw->pw_name, "root") == 0)
|
if (strcmp(pw->pw_name, "root") == 0)
|
||||||
setenv("PATH", ENV_SUPATH, 1);
|
setenv("PATH", ENV_SUPATH, 1);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue