diff src/content.c @ 196:60a70c16d79c noffle

[svn] * src/content.c: When generating temp file to write new content to, make sure there is no possibility of a name clash with an existing file. Bug spotted by Mirko Liss.
author bears
date Tue, 30 Oct 2001 13:55:53 +0000
parents f1bacee93ca6
children 24d4cd032da5
line wrap: on
line diff
--- a/src/content.c	Tue Oct 30 13:16:40 2001 +0000
+++ b/src/content.c	Tue Oct 30 13:55:53 2001 +0000
@@ -1,7 +1,7 @@
 /*
   content.c
 
-  $Id: content.c 307 2001-09-12 20:33:44Z bears $
+  $Id: content.c 315 2001-10-30 13:55:53Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -166,6 +166,7 @@
     }
     fclose( f );
 
+
     if ( cont.first == 0 )
 	setupEmpty( name );		/* Corrupt overview file recovery */
     else
@@ -197,8 +198,8 @@
 	return;
     
     /* Save the overview to temporary file in same dir. */
-    snprintf( tmpfname, MAXCHAR, "%s/overview/%s.%d",
-	      Cfg_spoolDir(), cont.name, (int) getpid() ); 
+    snprintf( tmpfname, MAXCHAR, "%s/overview/.#%d.%s",
+	      Cfg_spoolDir(), (int) getpid(), cont.name ); 
     if ( ! ( f = fopen( tmpfname, "w" ) ) )
     {
         Log_err( "Could not open %s for writing", tmpfname );