From mbsd@pacbell.net  Sat Apr 19 12:22:54 2003
Return-Path: <mbsd@pacbell.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 41F1337B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Apr 2003 12:22:54 -0700 (PDT)
Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A395643FDF
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Apr 2003 12:22:53 -0700 (PDT)
	(envelope-from mbsd@pacbell.net)
Received: from atlas (adsl-64-160-45-145.dsl.snfc21.pacbell.net [64.160.45.145])
	by mta7.pltn13.pbi.net (8.12.9/8.12.3) with ESMTP id h3JJMrMc006573
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Apr 2003 12:22:53 -0700 (PDT)
Message-Id: <20030419121839.U345@atlas.home>
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: Login does not (fully) honor .hushlogin

>Number:         51165
>Category:       bin
>Synopsis:       Login does not honor .hushlogin
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 19 12:30:17 PDT 2003
>Closed-Date:    Tue Jan 27 09:22:51 PST 2004
>Last-Modified:  Tue Jan 27 09:22:51 PST 2004
>Originator:     Mikko Tyljrvi
>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:
State-Changed-From-To: open->closed 
State-Changed-By: fjoe 
State-Changed-When: Tue Jan 27 09:21:27 PST 2004 
State-Changed-Why:  
Fixed in login.c rev. 1.98. 
Thanks for the report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51165 
>Unformatted:
