aboutsummaryrefslogtreecommitdiff
path: root/network/squidGuard
diff options
context:
space:
mode:
authorspaceman <spaceman@antispaceman.com>2015-05-02 21:52:27 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-05-02 21:53:52 +0700
commitbee30d9b82d91130eda058114b5957dcdb46bd3b (patch)
tree3f52e10ed8dbe95a68332ff66e6f899e238ab565 /network/squidGuard
parente763bbd8d9e6d0f62c3d9a8b23f481190edd8161 (diff)
network/squidGuard: Fix compatibility with Squid 3.4.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/squidGuard')
-rw-r--r--network/squidGuard/rewrite.patch73
-rw-r--r--network/squidGuard/squidGuard.SlackBuild4
2 files changed, 76 insertions, 1 deletions
diff --git a/network/squidGuard/rewrite.patch b/network/squidGuard/rewrite.patch
new file mode 100644
index 0000000000000..878a2af16752a
--- /dev/null
+++ b/network/squidGuard/rewrite.patch
@@ -0,0 +1,73 @@
+--- 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");
diff --git a/network/squidGuard/squidGuard.SlackBuild b/network/squidGuard/squidGuard.SlackBuild
index b79867661b570..c79c786bb1965 100644
--- a/network/squidGuard/squidGuard.SlackBuild
+++ b/network/squidGuard/squidGuard.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=squidGuard
VERSION=${VERSION:-1.4}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -79,6 +79,8 @@ find -L . \
# MAX_BUF value (4096).
patch -p1 < $CWD/squidGuard.patch
+# Patch to fix compatibility with SquidGuard 3.4
+patch -p1 < $CWD/rewrite.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \