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

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