]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Decouple the denied and authentication failure reports
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 30 Oct 2011 14:41:46 +0000 (14:41 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 30 Oct 2011 14:41:46 +0000 (14:41 +0000)
Both reports were produced if only one of them was requested in the
report_type option and there were enough material to produce the other
report.

log.c
report.c

diff --git a/log.c b/log.c
index 8b353da5a3197a07550d43708a4085dbbbfb5d24..f8b551a06f2f9fbf4883de0bea564e55f8dcd9ba 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1513,11 +1513,13 @@ int main(int argc,char *argv[])
                                fprintf(fp_Download_Unsort,"%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,download_url);
                        }
 
-                       if((ReportType & REPORT_TYPE_DENIED) != 0 || (ReportType & REPORT_TYPE_AUTH_FAILURES) != 0) {
+                       if((ReportType & REPORT_TYPE_DENIED) != 0) {
                                if(fp_denied && strstr(code,"DENIED/403") != 0) {
                                        fprintf(fp_denied, "%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,urly);
                                        denied_count++;
                                }
+                       }
+                       if((ReportType & REPORT_TYPE_AUTH_FAILURES) != 0) {
                                if(fp_authfail && (strstr(code,"DENIED/401") != 0 || strstr(code,"DENIED/407") != 0)) {
                                        fprintf(fp_authfail, "%s\t%s\t%s\t%s\t%s\n",dia,hora,user,ip,urly);
                                        authfail_count++;
index 8dcc838bfc9ff8fed9cfdffe0ac995d88b22d394..c54bdc6dc888ba8e125ffdd751f72731883c6a1b 100644 (file)
--- a/report.c
+++ b/report.c
@@ -368,9 +368,12 @@ void gerarel(void)
                        if((ReportType & REPORT_TYPE_TOPSITES) != 0) topsites();
 
                        if((ReportType & REPORT_TYPE_SITES_USERS) != 0) siteuser();
-                       gen_denied_report();
+                       
+                       if ((ReportType & REPORT_TYPE_DENIED) != 0)
+                               gen_denied_report();
 
-                       authfail_report();
+                       if ((ReportType & REPORT_TYPE_AUTH_FAILURES) != 0)
+                               authfail_report();
 
                        if(smartfilter) smartfilter_report();