Browse code

fix bb#1224

git-svn: trunk@4243

Tomasz Kojm authored on 2008/10/11 00:48:13
Showing 1 changed files
... ...
@@ -671,7 +671,7 @@ int submitstats(const char *clamdcfg, const struct cfgstruct *copt)
671 671
     close(fd);
672 672
 
673 673
     if(submitted || permfail) {
674
-	if((fd = open("stats.dat", O_WRONLY)) == -1) {
674
+	if((fd = open("stats.dat", O_WRONLY | O_CREAT | O_TRUNC, 0600)) == -1) {
675 675
 	    logg("^SubmitDetectionStats: Can't open stats.dat for writing\n");
676 676
 	} else {
677 677
 	    if((bread = write(fd, newstatsdat, sizeof(newstatsdat))) != sizeof(newstatsdat))