Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Apr 2003 12:22:53 -0700 (PDT)
From:      =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= <mbsd@pacbell.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/51165: Login does not (fully) honor .hushlogin
Message-ID:  <20030419121839.U345@atlas.home>
Resent-Message-ID: <200304191930.h3JJUH0X057009@freefall.freebsd.org>

index | next in thread | raw e-mail


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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030419121839.U345>