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