bin/75001

Rostislav Krasny rosti.bsd at gmail.com
Tue May 31 02:30:06 PDT 2005


The following reply was made to PR bin/75001; it has been noted by GNATS.

From: Rostislav Krasny <rosti.bsd at gmail.com>
To: Maxim Konovalov <maxim at macomnet.ru>
Cc: bug-followup at freebsd.org
Subject: Re: bin/75001
Date: Tue, 31 May 2005 12:16:09 +0200

 This is a multi-part message in MIME format.
 --------------050207050407070605070907
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Maxim Konovalov wrote:
 > Am I right you missed login_close(lc_user) call near the line 592?
 
 Yes, you are absolutely right. New diff is attached to this email.
 
 
 --------------050207050407070605070907
 Content-Type: text/plain;
  name="login.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="login.diff"
 
 diff -ur login.orig/login.c /usr/src/usr.bin/login/login.c
 --- login.orig/login.c	Mon Jan 26 22:04:47 2004
 +++ /usr/src/usr.bin/login/login.c	Tue May 31 10:56:34 2005
 @@ -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. */
 @@ -585,6 +589,7 @@
  		}
  	}
  
 +	login_close(lc_user);
  	login_close(lc);
  
  	(void)signal(SIGALRM, SIG_DFL);
 
 --------------050207050407070605070907--
 


More information about the freebsd-bugs mailing list