From 1bd73f70cd3d0379586082683205b63442968fd0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sun, 30 Oct 2011 14:41:46 +0000 Subject: [PATCH] Decouple the denied and authentication failure reports 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 | 4 +++- report.c | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/log.c b/log.c index 8b353da..f8b551a 100644 --- 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++; diff --git a/report.c b/report.c index 8dcc838..c54bdc6 100644 --- 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(); -- 2.47.2