From: Frederic Marchal Date: Thu, 30 May 2013 19:36:10 +0000 (+0200) Subject: Fix the reporting of downloaded files X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88776d28f3367d9822baae897c47c0a63611ddbc;p=thirdparty%2Fsarg.git Fix the reporting of downloaded files The reporting of downloaded files was in fact reporting the denied accesses since a previous changes in version 2.4. --- diff --git a/download.c b/download.c index 1bf745d..e8f11bf 100644 --- a/download.c +++ b/download.c @@ -87,7 +87,7 @@ void download_write(const struct ReadLogStruct *log_entry,const char *url) { char date[80]; - if (fp_download && strstr(log_entry->HttpCode,"DENIED") != 0) { + if (fp_download && strstr(log_entry->HttpCode,"DENIED") == 0) { strftime(date,sizeof(date),"%d/%m/%Y\t%H:%M:%S",&log_entry->EntryTime); fprintf(fp_download,"%s\t%s\t%s\t%s\n",date,log_entry->User,log_entry->Ip,url); download_exists=true; diff --git a/readlog.c b/readlog.c index d393025..75bf81b 100644 --- a/readlog.c +++ b/readlog.c @@ -623,7 +623,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq) denied_write(&log_entry); authfail_write(&log_entry); - download_write(&log_entry,download_url); + if (download_flag) download_write(&log_entry,download_url); if (current_format!=&ReadSargLog) { if (period.start.tm_year==0 || idata0){