[Slackbuilds-users] SquidGuard 1.4 vs. Squid 3.4 : patch for vanilla sources needed

spaceman spaceman at antispaceman.com
Sat May 2 13:41:48 UTC 2015


Hi Niki,

I have the following patch in addition to the squidGuard patch already in the 
slackbuild. I don't remember where I got it from.

patch -p1 < $CWD/squidGuard.patch
patch -p1 < $CWD/rewrite.patch

squidGuard appears to work after it is applied. You can merge them if you 
would like.

Regards,
spaceman

Just putting it out there.

On 2015/05/02 09:05:51 , Niki Kovacs wrote:
>Le 02/05/2015 08:48, Panagiotis Nikolaou a écrit :
>>Hi Niki
>>
>>i have attached SquidGuard patch.
>
>This doesn't work with the vanilla sources.
>
>-- 
>Microlinux - Solutions informatiques durables
>7, place de l'église - 30730 Montpezat
>Web  : http://www.microlinux.fr
>Mail : info at microlinux.fr
>Tél. : 04 66 63 10 32
>_______________________________________________
>SlackBuilds-users mailing list
>SlackBuilds-users at slackbuilds.org
>http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
>Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
>FAQ - http://slackbuilds.org/faq/
>
-------------- next part --------------
--- squidGuard-1.4.orig/src/main.c	2013-12-11 17:42:15.000000000 +1300
+++ squidGuard-1.4.orig/src/main.c	2013-12-11 19:04:09.000000000 +1300
@@ -175,7 +175,7 @@ 
 	sgReloadConfig();
       }
       if(failsafe_mode) {
-	puts("");
+	puts("ERR message=\"squidGuard failsafe mode\"");
 	fflush(stdout);
 	if(sig_hup){
           sgReloadConfig();
@@ -184,7 +184,7 @@ 
       }
       if(parseLine(buf,&squidInfo) != 1){
 	sgLogError("Error parsing squid line: %s",buf);
-	puts("");
+	puts("BH message=\"squidGuard error parsing squid line\"");
       }
         else {
 	src = Source;
@@ -196,14 +196,14 @@ 
 	  acl = sgAclCheckSource(src);
 	  if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){
 	    if(src == NULL || src->cont_search == 0){
-	      puts(""); 
+	      puts("ERR");
 	      break;
 	    } else
 	      if(src->next != NULL){
 		src = src->next;
 		continue;
 	      } else {
-		puts("");
+		puts("ERR");
 		break;
 	      }
 	  } else {
@@ -215,9 +215,10 @@ 
 	      squidInfo.ident[0] = '-';
 	      squidInfo.ident[1] = '\0';
 	    }
-	    fprintf(stdout,"%s %s/%s %s %s\n",redirect,squidInfo.src,
-		    squidInfo.srcDomain,squidInfo.ident,
-		    squidInfo.method);
+	    if (isdigit(redirect[0]) && isdigit(redirect[1]) && isdigit(redirect[2]) && redirect[3]==':') {
+	      fprintf(stdout,"OK status=%c%c%c url=\"%s\"\n", redirect[0], redirect[1], redirect[2], &redirect[4]);
+	    } else
+	      fprintf(stdout,"OK rewrite-url=\"%s\"\n",redirect);
             /* sgLogError("%s %s/%s %s %s\n",redirect,squidInfo.src,squidInfo.srcDomain,squidInfo.ident,squidInfo.method);  */
 	    break;
 	  }
--- squidGuard-1.4.orig/src/sgDiv.c	2013-12-11 17:42:15.000000000 +1300
+++ squidGuard-1.4.orig/src/sgDiv.c	2013-12-11 18:58:33.000000000 +1300
@@ -771,7 +771,7 @@ 
   }
   sgLogError("Going into emergency mode");
   while(fgets(buf, MAX_BUF, stdin) != NULL){
-    puts("");
+    puts("ERR");
     fflush(stdout);
   }
   sgLogError("ending emergency mode, stdin empty");
--- squidGuard-1.4.orig/src/sgDiv.c.in	2013-12-11 17:42:15.000000000 +1300
+++ squidGuard-1.4.orig/src/sgDiv.c.in	2013-12-11 18:58:40.000000000 +1300
@@ -782,7 +782,7 @@ 
   }
   sgLogError("Going into emergency mode");
   while(fgets(buf, MAX_BUF, stdin) != NULL){
-    puts("");
+    puts("ERR");
     fflush(stdout);
   }
   sgLogError("ending emergency mode, stdin empty");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20150502/f84def46/attachment.asc>


More information about the SlackBuilds-users mailing list