commit 01fa8eec5842f90e8afa60e3429daa87ee104e22
Author: sin <[email protected]>
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
@@ -5,7 +5,7 @@
 BloginR [B-pR] IusernameR
 .SH DESCRIPTION
 BloginR logs the IusernameR into the system.  It sets BHOMER,
-BSHELLR, BUSERR, BLOGNAMER, BTERMR and the BPATHR environment
+BSHELLR, BUSERR, BLOGNAMER and the BPATHR environment
 variables and invokes the login shell as specified in I/etc/passwdR.
 .SH OPTIONS
 .TP
diff --git a/login.c b/login.c
index fa01371..bc90818 100644
--- a/login.c
+++ b/login.c
@@ -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);


Reply via email to