[hackers] [ubase] Fix login(1) -p semantincs once and for all || sin
commit 01fa8eec5842f90e8afa60e3429daa87ee104e22
Author: sin <sin_AT_2f30.org>
Date: Tue Jun 3 18:56:46 2014 +0100
Fix login(1) -p semantincs once and for all
diff --git a/login.1 b/login.1
index 4d13d73..e810c73 100644
--- a/login.1
+++ b/login.1
_AT_@ -5,7 +5,7 @@
BloginR [B-pR] IusernameR
.SH DESCRIPTION
BloginR logs the IusernameR into the system. It sets BHOMER,
-BSHELLR, BUSERR, BLOGNAMER, BTERMR and the BPATHR environment
+BSHELLR, BUSERR, BLOGNAMER and the BPATHR environment
variables and invokes the login shell as specified in I/etc/passwdR.
.SH OPTIONS
.TP
diff --git a/login.c b/login.c
index fa01371..bc90818 100644
--- a/login.c
+++ b/login.c
_AT_@ -113,12 +113,11 @@ dologin(struct passwd *pw, int preserve)
{
if (preserve == 0)
clearenv();
- setenv("HOME", pw->pw_dir, !preserve);
- setenv("SHELL", pw->pw_shell, !preserve);
- setenv("USER", pw->pw_name, !preserve);
- setenv("LOGNAME", pw->pw_name, !preserve);
- setenv("TERM", "linux", !preserve);
- setenv("PATH", ENV_PATH, !preserve);
+ setenv("HOME", pw->pw_dir, 1);
+ setenv("SHELL", pw->pw_shell, 1);
+ setenv("USER", pw->pw_name, 1);
+ setenv("LOGNAME", pw->pw_name, 1);
+ setenv("PATH", ENV_PATH, 1);
if (chdir(pw->pw_dir) < 0)
eprintf("chdir %s:", pw->pw_dir);
execlp(pw->pw_shell, pw->pw_shell, "-l", NULL);
Received on Tue Jun 03 2014 - 19:57:41 CEST
This archive was generated by hypermail 2.3.0
: Tue Jun 03 2014 - 20:00:12 CEST