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

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