From 45634030bcc423ff700247a1d5cffd57b809e3c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Tue, 11 May 2010 08:26:17 +0000 Subject: [PATCH] List the source of the redirection rule in a squidGuard log --- CMakeLists.txt | 2 +- include/info.h | 2 +- squidguard_log.c | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c82e7c2..ccf2458 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(sarg C) SET(sarg_VERSION 2) SET(sarg_REVISION "3-pre2") SET(sarg_BUILD "") -SET(sarg_BUILDDATE "May-10-2010") +SET(sarg_BUILDDATE "May-11-2010") INCLUDE(AddFileDependencies) INCLUDE(CheckIncludeFile) diff --git a/include/info.h b/include/info.h index 53af908..87c66a2 100755 --- a/include/info.h +++ b/include/info.h @@ -1,3 +1,3 @@ -#define VERSION PACKAGE_VERSION" May-10-2010" +#define VERSION PACKAGE_VERSION" May-11-2010" #define PGM PACKAGE_NAME #define URL "http://sarg.sourceforge.net" diff --git a/squidguard_log.c b/squidguard_log.c index 19abe1d..32e42e7 100644 --- a/squidguard_log.c +++ b/squidguard_log.c @@ -37,7 +37,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) char buf[MAXLEN]; char leks[5], sep[2], res[MAXLEN]; char mon[20], day[3], year[5], hour[15]; - char list[MAXLEN]; + char source[128], list[128]; char wdata[127]; char url[MAX_URL_LEN]; char user[MAX_USER_LEN]; @@ -165,7 +165,8 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) } else { if (getword(year,sizeof(year),&gwarea,'-')<0 || getword(mon,sizeof(mon),&gwarea,'-')<0 || getword(day,sizeof(day),&gwarea,' ')<0 || getword(hour,sizeof(hour),&gwarea,' ')<0 || - getword_skip(MAXLEN,&gwarea,'/')<0 || getword(list,sizeof(list),&gwarea,'/')<0 || + getword_skip(MAXLEN,&gwarea,'(')<0 || + getword(source,sizeof(source),&gwarea,'/')<0 || getword(list,sizeof(list),&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,' ')<0 || getword(url,sizeof(url),&gwarea,' ')<0 || getword(ip,sizeof(ip),&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,' ')<0 || getword(user,sizeof(user),&gwarea,' ')<0) { @@ -222,7 +223,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) if(Ip2Name && id_is_ip) ip2name(user,sizeof(user)); user_find(uinfo->label,MAX_USER_LEN, user); } - fprintf(fp_ou,"%s\t%s%s%s\t%s\t%s\t%s\t%s\n",uinfo->id,year,mon,day,hour,ip,url,list); + fprintf(fp_ou,"%s\t%s%s%s\t%s\t%s\t%s\t%s/%s\n",uinfo->id,year,mon,day,hour,ip,url,source,list); squidguard_count++; } if (fp_in) fclose(fp_in); -- 2.47.2