Revision: 7504 http://sourceforge.net/p/ipcop/svn/7504 Author: owes Date: 2014-04-26 06:07:52 +0000 (Sat, 26 Apr 2014) Log Message: ----------- Fix squidGuard -f option
Modified Paths: -------------- ipcop/trunk/lfs/squidGuard ipcop/trunk/src/patches/squidGuard-1.5-beta_stdout-always.patch Modified: ipcop/trunk/lfs/squidGuard =================================================================== --- ipcop/trunk/lfs/squidGuard 2014-04-25 14:05:24 UTC (rev 7503) +++ ipcop/trunk/lfs/squidGuard 2014-04-26 06:07:52 UTC (rev 7504) @@ -104,7 +104,7 @@ # Fix 'yyunput' and 'input' defined but not used cd $(DIR_APP) && sed -i 's/ignore /%option noinput\n%option nounput\n&/' src/sg.l # add additional version info - cd $(DIR_APP) && sed -i 's:#define VERSION\(.*\):#define VERSION\1 \" \(IPCop patchlevel 2\)\":g' src/version.h + cd $(DIR_APP) && sed -i 's:#define VERSION\(.*\):#define VERSION\1 \" \(IPCop patchlevel 3\)\":g' src/version.h # Use --with-db, so /usr/local does not appear for db cd $(DIR_APP) && ./configure --prefix=/usr \ Modified: ipcop/trunk/src/patches/squidGuard-1.5-beta_stdout-always.patch =================================================================== --- ipcop/trunk/src/patches/squidGuard-1.5-beta_stdout-always.patch 2014-04-25 14:05:24 UTC (rev 7503) +++ ipcop/trunk/src/patches/squidGuard-1.5-beta_stdout-always.patch 2014-04-26 06:07:52 UTC (rev 7504) @@ -2,7 +2,7 @@ when option -f is given on squidGuard start We have to remember the raw original URL as the URL is modified for testing purpose. So the exisiting HTML entities like %3F (?), %26 (&), %3D (=) etc. are changed -which brakes the URL for further processing if it is send to stdout like we do it for the +which breaks the URL for further processing if it is send to stdout like we do it for the redirector chain (THIS patch). diff -Nur a/src/main.c.in b/src/main.c.in --- a/src/main.c.in 2009-09-27 21:41:50.000000000 +0200 @@ -15,6 +15,14 @@ int globalPid = 0; int globalUpdate = 0; int passthrough = 0; +@@ -89,6 +90,7 @@ + struct Acl *acl; + struct timeval start_time,ready_time,stop_time; + char buf[MAX_BUF]; ++ char origraw[MAX_BUF]; + char *redirect,tmp[MAX_BUF]; + char *configFile = NULL; + time_t t; @@ -101,11 +102,14 @@ #ifdef USE_SYSLOG openlog("squidGuard", LOG_PID | LOG_NDELAY | LOG_CONS, LOG_@LOGFAC@); @@ -31,12 +39,21 @@ case 'c': configFile = optarg; break; +@@ -192,6 +193,8 @@ + } + continue; + } ++ strcpy(origraw,buf); ++ if (strlen(origraw) && (origraw[strlen(origraw)-1] == '\n')) origraw[strlen(origraw)-1] = 0; + if(parseLine(buf,&squidInfo) != 1){ + sgLogError("ERROR: Error parsing squid line: %s",buf); + puts("BH message=\"squidGuard error parsing squid line\""); @@ -206,7 +210,12 @@ acl = sgAclCheckSource(src); if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){ if(src == NULL || src->cont_search == 0){ + if (globalFullStdout) { -+ puts(buf); ++ puts(origraw); + } + else { puts("ERR"); @@ -44,12 +61,12 @@ break; } else if(src->next != NULL){ -@@ -222,7 +223,12 @@ +@@ -213,7 +214,12 @@ src = src->next; continue; } else { + if (globalFullStdout) { -+ puts(buf); ++ puts(origraw); + } + else { puts("ERR"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn