]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Tolerate longer URLs when reading the access.log file provided that long_url is not set
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 5 Feb 2010 08:22:15 +0000 (08:22 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 5 Feb 2010 08:22:15 +0000 (08:22 +0000)
CMakeLists.txt
ChangeLog
dansguardian_log.c
download.c
include/conf.h
include/info.h
log.c
realtime.c
squidguard_log.c
topuser.c

index e005ab5d0d0683a40c182000aabd40d62e66565e..6259f186793f1eb65a979280e13f4efe4c6700c6 100755 (executable)
@@ -3,7 +3,7 @@ PROJECT(sarg C)
 SET(sarg_VERSION 2)
 SET(sarg_REVISION 2)
 SET(sarg_BUILD "7")
-SET(sarg_BUILDDATE "Feb-04-2010")
+SET(sarg_BUILDDATE "Feb-05-2010")
 
 INCLUDE(AddFileDependencies)
 INCLUDE(CheckIncludeFile)
index 2301f50592dda0d3423e6e893fa5dc59654afcba..c52bcbfc2001db4e50eefdc725dd6f10283aabc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
 SARG ChangeLog
 
-Feb-04-2010 Version 2.2.7
+Feb-05-2010 Version 2.2.7
                - Extra compile and run time protection (FORTIFY_SOURCE) fixed in configure.
                - Use tabulations as columns separator in intermediary files to avoid problems when a field of the log contains a space.
                - Input log file type detection partly rewritten to clearly distinguish which type is processed where.
@@ -26,6 +26,7 @@ Feb-04-2010 Version 2.2.7
                - Mangle the $ and @ signs in user ID to make the resulting file name valid in shell commands.
                - Fixed a regression in the default value of --enable-sargphp.
                - Increase the maximum size of a line read from access.log and detect longer lines that were silently splitted in previous versions.
+               - Tolerate longer URLs during the reading of the access.log to have less chances of aborting during that phase. It only helps if short URLs are output in the reports. If long_url is set, sarg will still abort on over sized URLs.
 
 Jan-06-2010 Version 2.2.6.1
                - Remove unnecessary dependency on off_t.
index 0595aa0e28c62c6ee370e76e5c838e2198b1a678..8edb94231b47703c4fa190aa1ae89073687c1350 100644 (file)
@@ -39,6 +39,8 @@ void dansguardian_log(void)
    char user[MAXLEN], code1[255], code2[255];
    char ip[30];
    char wdata[127];
+   char url[MAXLEN];
+   char urly[MAXLEN];
    int  idata=0;
    int cstatus;
    struct getwordstruct gwarea;
index d0594b921ecd0250c0d3455ee0b33b41ba63bd1a..3ee62730b1641cfa9b84b374674272458ab8cef4 100644 (file)
@@ -36,7 +36,7 @@ void download_report(void)
 
    FILE *fp_in = NULL, *fp_ou = NULL;
 
-   char url[MAXLEN];
+   char url[2*MAXLEN];
    char report_in[MAXLEN];
    char wdirname[MAXLEN];
    char report[MAXLEN];
@@ -160,7 +160,7 @@ void download_report(void)
             continue;
       }
 
-      for (i=strlen(url)-1 ; i>=0 && (unsigned char)url[i]<' ' ; i--) url[i]=0;
+      for (i=strlen(url)-1 ; i>=0 && (unsigned char)url[i]<' ' ; i--) url[i]='\0';
 
       fprintf(fp_ou,"<tr><td class=\"data\">%s</td><td class=\"data\">%s</td><td class=\"data\">%s-%s</td><td class=\"data2\">",name,ip,data,hora);
       if(BlockIt[0]!='\0')
index 54be925e667b09ee0c4edfb51daef9b266846bce..2420d657910189c2d6f1b5d7b26dbee8f87000da 100755 (executable)
@@ -138,8 +138,6 @@ FILE *fp_tt;
 char outdir[MAXLEN];
 char dirname[MAXLEN];
 char buf[MAXLEN];
-char url[MAXLEN];
-char urly[MAXLEN];
 char user[MAXLEN];
 char period[MAXLEN];
 char msg[1024];
index e0693c948ddf3ed8e3ae8db2abd285f944d4644c..585069f1401f93fe00c9b61e6baa314fd6a32821 100755 (executable)
@@ -1,3 +1,3 @@
-#define VERSION PACKAGE_VERSION" Feb-04-2010"
+#define VERSION PACKAGE_VERSION" Feb-05-2010"
 #define PGM PACKAGE_NAME
 #define URL "http://sarg.sourceforge.net"
diff --git a/log.c b/log.c
index 366909bfc186ae92f0ef4313643c4afd7bca671e..68469ba2ba1f87ae2268e3aebb9964b9d41b3a1e 100644 (file)
--- a/log.c
+++ b/log.c
@@ -98,7 +98,9 @@ int main(int argc,char *argv[])
    char tbuf2[128];
    char zip[20];
    char *str;
-   char bufz[2*MAXLEN];
+   char bufz[2*MAXLEN+1000];
+   char url[2*MAXLEN];
+   char urly[2*MAXLEN];
    char tmp2[MAXLEN];
    char start_hour[128];
    char end_hour[128];
@@ -129,7 +131,7 @@ int main(int argc,char *argv[])
    unsigned long recs2=0UL;
    int OutputNonZero = REPORT_EVERY_X_LINES ;
    int download_flag=0;
-   char download_url[MAXLEN];
+   char download_url[2*MAXLEN];
    char sz_Last_User[MAXLEN]="";
    struct getwordstruct gwarea;
 
index 3db426821bfe0e8671778875ed95f168ebdccb93..37129027f7b2a757545cc2bd1cf4fc4a879632db 100755 (executable)
@@ -92,6 +92,7 @@ static int getdata(char *rec, FILE *ftmp)
    struct tm *t;
    char tbuf[128];
    char warea[MAXLEN];
+   char url[MAXLEN];
    struct getwordstruct gwarea;
 
    getword_start(&gwarea,rec);
@@ -171,6 +172,7 @@ static void datashow(const char *tmp)
 {
    FILE *fin;
    char buf[MAXLEN];
+   char url[MAXLEN];
    struct getwordstruct gwarea;
 
    if((fin=fopen(tmp,"r"))==NULL) {
index 1e6b3ba24970f4f071bbac3cc45976c192724624..6307b6c859bdd5458d7d2080e0ce99d0324e0ce5 100644 (file)
@@ -38,6 +38,8 @@ static void read_log(const char *wentp, FILE *fp_ou)
    char mon[10], hour[15];
    char list[MAXLEN];
    char wdata[127];
+   char url[MAXLEN];
+   char urly[MAXLEN];
    int  idata=0;
    int  i;
    char *str;
index 636066007ef09966e329e7a073133b6019ad5055..971ada06a83048f20d442968bfa34c10f89d0dcf 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -64,6 +64,7 @@ void topuser(void)
    char href1end[5];
    char href2end[5];
    char href3end[5];
+   char url[MAXLEN];
    struct getwordstruct gwarea;
 
    ipantes[0]='\0';