Blame SOURCES/shadow-4.2.1-no-lock-dos.patch

4fb1b2
Index: shadow-4.5/lib/commonio.c
4fb1b2
===================================================================
4fb1b2
--- shadow-4.5.orig/lib/commonio.c
4fb1b2
+++ shadow-4.5/lib/commonio.c
4fb1b2
@@ -140,7 +140,10 @@ static int do_lock_file (const char *fil
4fb1b2
 	int retval;
4fb1b2
 	char buf[32];
4fb1b2
 
4fb1b2
-	fd = open (file, O_CREAT | O_EXCL | O_WRONLY, 0600);
4fb1b2
+	/* We depend here on the fact, that the file name is pid-specific.
4fb1b2
+	 * So no O_EXCL here and no DoS.
4fb1b2
+	 */
4fb1b2
+	fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, 0600);
4fb1b2
 	if (-1 == fd) {
4fb1b2
 		if (log) {
4fb1b2
 			(void) fprintf (stderr,