[hackers] [ubase] Fix login(1) -p semantincs once and for all || sin

From: <git_AT_suckless.org>
Date: Tue, 03 Jun 2014 19:57:41 +0200

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 @@
  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
_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