Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jan 1999 22:40:01 -0800 (PST)
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/9247: pw/pwd_mkdb deadlock on /etc/master.passwd
Message-ID:  <199901040640.WAA12583@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/9247; it has been noted by GNATS.

From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To: Jos Backus <jbackus@plex.nl>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, dillon@FreeBSD.ORG, billf@FreeBSD.ORG
Subject: Re: bin/9247: pw/pwd_mkdb deadlock on /etc/master.passwd
Date: Mon, 04 Jan 1999 15:31:06 +0900

 jbackus> 	This fix makes things work but is of course unacceptable in this form. The
 jbackus> 	problem seems to be that endpwent() doesn't actually close fd 4.
 jbackus> 
 jbackus> 	 pwupd.c.orig	Wed Dec 30 18:00:19 1998
 jbackus> 	 pwupd.c	Wed Dec 30 18:00:00 1998
 jbackus> 	 -109,6 +109,7 @@
 jbackus>  	int             rc = 0;
 jbackus>  
 jbackus>  	endpwent();
 jbackus> +	close(4);
 jbackus>  
 jbackus>  	/*
 jbackus>  	 * First, let's check the see if the database is alright
 
 I have same promblem here.
 master.passwd is not used by getpwent, which uses only pwd.db or spwd.db,
 but it is locked by pw itselt, see main() of pw.c:
 
 	/*
 	 * Try to lock the master passowrd and group files right away (we
 	 * don't care if it works, since this is just advisory locking.
 	 */
 	filelock(_PATH_GROUP);
 	filelock(_PATH_MASTERPASSWD);
 
 We need to unlock(close) before calling "pwd_mkdb" or to have non-lock option
 in pwd_mkdb.c.
 
 /\ Hidetoshi Shimokawa
 \/  simokawa@sat.t.u-tokyo.ac.jp
 PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp
 
 
 
 
 

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?199901040640.WAA12583>