Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  2 Apr 2000 14:59:08 -0400 (EDT)
From:      danh@wzrd.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/17756: sshd ignores .hushlogin
Message-ID:  <20000402185908.AF75D5D06F@mail.wzrd.com>

next in thread | raw e-mail | index | archive | help

>Number:         17756
>Category:       bin
>Synopsis:       sshd ignores .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:   Sun Apr  2 12:00:03 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Dan Harnett
>Release:        FreeBSD 4.0-RELEASE
>Organization:
>Environment:

	FreeBSD 4.0-RELEASE i386

>Description:

	sshd ignores the existence of a .hushlogin file in a users home
	directory for a quiet login.  Setting the capability in /etc/login.conf
	works great however.

>How-To-Repeat:

	Create a .hushlogin file in your home directory.  Make sure the
	hushlogin capability for your login class does not exist.  Use a
	secure shell client to login.  Appropriate behavior would be to not
	print the copyright, last login, and message of the day.

>Fix:
	
	Apply the following patch.  It would appear the third argument to
	login_getcapbool(3) does not affect the return value if the capability
	is not found.  It only has an affect when the first or second arguments
	are NULL.

--- sshd.c.orig	Sun Apr  2 13:57:22 2000
+++ sshd.c	Sun Apr  2 14:20:33 2000
@@ -2289,12 +2289,12 @@
 
 		/* Check if .hushlogin exists. */
 		snprintf(line, sizeof line, "%.200s/.hushlogin", pw->pw_dir);
-		quiet_login = stat(line, &st) >= 0;
 #ifdef LOGIN_CAP
 		lc = login_getpwclass(pw);
-		if (lc == NULL)
-			lc = login_getclassbyname(NULL, pw);
-		quiet_login = login_getcapbool(lc, "hushlogin", quiet_login);
+		quiet_login = (stat(line, &st) >= 0) 
+			|| login_getcapbool(lc, "hushlogin", 0);
+#else
+		quiet_login = stat(line, &st) >= 0;
 #endif /* LOGIN_CAP */
 
 #ifdef __FreeBSD__

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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