# HG changeset patch # User bears # Date 1004450153 0 # Node ID 60a70c16d79cb4e002a2ed1b0bd22e8cf22e0134 # Parent 76460d98b2fb2820315169633d9eb9ac89353ede [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. diff -r 76460d98b2fb -r 60a70c16d79c ChangeLog --- a/ChangeLog Tue Oct 30 13:16:40 2001 +0000 +++ b/ChangeLog Tue Oct 30 13:55:53 2001 +0000 @@ -1,3 +1,9 @@ +Tue Oct 30 2001 Jim Hague + +* 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. + Tue Oct 30 2001 Jim Hague * noffle.conf.example,docs/noffle.conf.5,src/configfile.h,src/configfile.c, diff -r 76460d98b2fb -r 60a70c16d79c src/content.c --- 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 );