Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Dec 2004 14:21:23 -0800 (PST)
From:      Rostislav Krasny <rosti_bsd@yahoo.com>
To:        freebsd-stable@freebsd.org
Subject:   [PATCH] (was: hushlogin attribute)
Message-ID:  <20041212222123.3029.qmail@web14826.mail.yahoo.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
The attached patch of login(1) allows hushlogin and nocheckmail attributes
to work from the user's '.login_conf' as well as from the '/etc/login.conf'.


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail
[-- Attachment #2 --]
--- /usr/src/usr.bin/login/login.c	Mon Jan 26 22:04:47 2004
+++ login.c	Mon Dec 13 00:16:14 2004
@@ -171,6 +171,7 @@
 	const char *tp;
 	const char *shell = NULL;
 	login_cap_t *lc = NULL;
+	login_cap_t *lc_user = NULL;
 	pid_t pid;
 
 	(void)signal(SIGQUIT, SIG_IGN);
@@ -354,8 +355,10 @@
 	 * Establish the login class.
 	 */
 	lc = login_getpwclass(pwd);
+	lc_user = login_getuserclass(pwd);
 
-	quietlog = login_getcapbool(lc, "hushlogin", 0);
+	if (!(quietlog = login_getcapbool(lc_user, "hushlogin", 0)))
+		quietlog = login_getcapbool(lc, "hushlogin", 0);
 
 	/*
 	 * Switching needed for NFS with root access disabled.
@@ -568,7 +571,8 @@
 		else
 			motd(_PATH_MOTDFILE);
 
-		if (login_getcapbool(lc, "nocheckmail", 0) == 0) {
+		if (login_getcapbool(lc_user, "nocheckmail", 0) == 0 &&
+		    login_getcapbool(lc, "nocheckmail", 0) == 0) {
 			char *cx;
 
 			/* $MAIL may have been set by class. */
help

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