From 2918e2a81edd9eff3555bd81ca9500fe345c62c0 Mon Sep 17 00:00:00 2001 From: Nate Williams Date: Thu, 16 Jul 1998 17:18:25 +0000 Subject: Fix race condition in pw caused by multiple instances of pwd_mkdb being run at the same time. Notes: The fileupdate function is still somewhat broken. Instead of returning a failure code if it can't modify the original file it renames the .new file and continues as though nothing is wrong. This will cause the lock on the original file to be lost and could lead to a similar race condition. I left that portion of the code alone since I feel that the maintainer of the code would have a better concept of how he wants to handle errors in that function than I do. PR: bin/6787 Submitted by: Craig Spannring --- pw/edgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pw/edgroup.c') diff --git a/pw/edgroup.c b/pw/edgroup.c index c927b06..6116fa6 100644 --- a/pw/edgroup.c +++ b/pw/edgroup.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "$Id$"; + "$Id: edgroup.c,v 1.5 1997/10/10 06:23:30 charnier Exp $"; #endif /* not lint */ #include @@ -64,7 +64,7 @@ editgroups(char *name, char **groups) int rc = 0; int infd; - if ((infd = open(groupfile, O_RDWR | O_CREAT | O_EXLOCK, 0644)) != -1) { + if ((infd = open(groupfile, O_RDWR | O_CREAT, 0644)) != -1) { FILE *infp; if ((infp = fdopen(infd, "r+")) == NULL) -- cgit v1.2.3-56-ge451