bin/51165: Login does not (fully) honor .hushlogin
Mikko Työläjärvi
mbsd at pacbell.net
Sat Apr 19 12:30:19 PDT 2003
>Number: 51165
>Category: bin
>Synopsis: Login does not honor .hushlogin
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Apr 19 12:30:17 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Mikko Työläjärvi
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD sotec.home 5.0-CURRENT FreeBSD 5.0-CURRENT #12: Tue Apr 15 20:23:34 PDT 2003 mikko at sotec.home:/usr/obj/usr/src/sys/SOTEC i386
>Description:
Login does not suppress the "Last login" message (from pam_lastlog)
when $HOME/.hushlogin exists. Having "hushlogin" in login.conf does
work work.
If this is unintentional, apply the patch below.
Otherwise change login(1) and login.conf(5), which claim that having
a ".hushlogin" file suppresses all messages, and that the
"hushlogin" capability is equivalent to having a ".hushlogin" file.
>How-To-Repeat:
Create ~/.hushlogin.
Log in on console, via rlogin or via telnet.
"Last login" message is printed.
>Fix:
--- /usr/src/usr.bin/login/login.c Sat Feb 15 19:33:44 2003
+++ login.c Sat Apr 19 12:03:08 2003
@@ -356,8 +356,6 @@
lc = login_getpwclass(pwd);
quietlog = login_getcapbool(lc, "hushlogin", 0);
- if (!quietlog)
- pam_silent = 0;
/*
* Switching needed for NFS with root access disabled.
@@ -385,6 +383,8 @@
(void)setegid(egid);
if (!quietlog)
quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0;
+ if (!quietlog)
+ pam_silent = 0;
shell = login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell);
if (*pwd->pw_shell == '\0')
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list