From owner-freebsd-questions Mon Sep 27 2:55:18 1999 Delivered-To: freebsd-questions@freebsd.org Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 3C3CA15274 for ; Mon, 27 Sep 1999 02:55:13 -0700 (PDT) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.02 #1) id 11VXUe-000OTH-00; Mon, 27 Sep 1999 11:54:48 +0200 From: Sheldon Hearn To: slava Cc: freebsd-questions@FreeBSD.ORG Subject: Re: loosing users from master.passwd In-reply-to: Your message of "Fri, 24 Sep 1999 10:36:13 +0300." Date: Mon, 27 Sep 1999 11:54:48 +0200 Message-ID: <94070.938426088@axl.noc.iafrica.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 24 Sep 1999 10:36:13 +0300, slava wrote: > Users are added only by using 'pw' and 'chpass'. I made a test > starting five 'pw useradd' processes at once and after I repeated it > a couple of times I was able to reproduce the problem again. it looks > like a lock on the master.passwd file is not working properly. I haven't tested my hypothesis, but I believe that pw's fileupdate() function erroneously reports success on file lock failure. What happens when you try with the patch below? Please be careful, I spent all of 2 minutes on this. :-) Ciao, Sheldon. Index: fileupd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/fileupd.c,v retrieving revision 1.8 diff -u -d -r1.8 fileupd.c --- fileupd.c 1999/08/28 01:19:17 1.8 +++ fileupd.c 1999/09/27 09:52:29 @@ -188,6 +188,8 @@ fclose(outfp); } remove(file); + } else { + rc = errno; } fclose(infp); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message