]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Overwrite any existing dansguardian temporary file
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 9 Sep 2012 13:44:26 +0000 (15:44 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 9 Sep 2012 13:44:26 +0000 (15:44 +0200)
When sarg parses a dansguardian log, the temporary file to store the
parsed value is overwritten if it exists instead of appending the entries
at the end of any left over from a previous run.

dansguardian_log.c

index 3701a79d17f562571417fb04b902fe4a4737b75b..874fa06dc12c4d7ab908a9fbfbc51368ef3322e8 100644 (file)
@@ -62,7 +62,7 @@ void dansguardian_log(void)
                exit(EXIT_FAILURE);
        }
 
-       if((fp_ou=MY_FOPEN(guard_in,"a"))==NULL) {
+       if((fp_ou=MY_FOPEN(guard_in,"w"))==NULL) {
                debuga(_("(dansguardian) Cannot open log file %s: %s\n"),guard_in,strerror(errno));
                exit(EXIT_FAILURE);
        }