Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Sep 1999 11:54:48 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        slava <sl@zeus.dnt.md>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: loosing users from master.passwd 
Message-ID:  <94070.938426088@axl.noc.iafrica.com>
In-Reply-To: Your message of "Fri, 24 Sep 1999 10:36:13 %2B0300." <Pine.BSF.4.05.9909241021130.69406-100000@zeus.dnt.md> 

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


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




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