]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - authfail.c
Add a safety to prevent the deletion of files that haven't been created
[thirdparty/sarg.git] / authfail.c
index 60b4657c2a07c32e2807cc7236c6a2ab7b7bcfef..dd15e69a921fefd6b2326630d27fbb27f5d8e4ca 100644 (file)
@@ -138,7 +138,7 @@ void authfail_report(void)
        struct tm t;
 
        if (!authfail_exists) {
-               if (!KeepTempLog && unlink(authfail_unsort))
+               if (!KeepTempLog && authfail_unsort[0]!='\0' && unlink(authfail_unsort))
                        debuga(_("Failed to delete \"%s\": %s\n"),authfail_unsort,strerror(errno));
 
                authfail_unsort[0]='\0';