Index: Makefile =================================================================== --- Makefile +++ Makefile @@ -17,6 +17,8 @@ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING +RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid + USE_BDB= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-db-inc=${BDB_INCLUDE_DIR} \ @@ -42,20 +44,12 @@ SUB_LIST= PORTNAME=${PORTNAME} OPTIONS_DEFINE= DNS_BL DOCS EXAMPLES LDAP QUOTE_STRING -OPTIONS_SINGLE= SV -OPTIONS_SINGLE_SV= SQUID34 SQUID33 -OPTIONS_DEFAULT= SQUID34 EXAMPLES_DESC= Install sample blacklists DNS_BL_DESC= Enable DNS based blacklists QUOTE_STRING_DESC= Add quoted string patch -SQUID33_DESC= Depend on Squid 3.3 (DEPERCATED) -SQUID34_DESC= Depend on Squid 3.4 OPTIONS_SUB= yes -SQUID33_RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid33 -SQUID34_RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid -SQUID34_EXTRA_PATCHES= ${FILESDIR}/extrapatch-squid34:-p1 QUOTE_STRING_EXTRA_PATCHES= ${DISTDIR}/squidGuard-1.4-quoted_string_support.diff:-p2 DNS_BL_EXTRA_PATCHES= ${DISTDIR}/squidGuard-1.4-dnsbl.patch:-p1 LDAP_CONFIGURE_ON= --with-ldap Index: files/extrapatch-squid34 =================================================================== --- files/extrapatch-squid34 +++ files/extrapatch-squid34 @@ -1,76 +0,0 @@ -diff -urN squidGuard-1.4.orig/src/main.c squidGuard-1.4.upgraded/src/main.c ---- squidGuard-1.4.orig/src/main.c 2013-12-11 17:42:15.000000000 +1300 -+++ squidGuard-1.4.upgraded/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; - } -diff -urN squidGuard-1.4.orig/src/sgDiv.c squidGuard-1.4.upgraded/src/sgDiv.c ---- squidGuard-1.4.orig/src/sgDiv.c 2013-12-11 17:42:15.000000000 +1300 -+++ squidGuard-1.4.upgraded/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"); -diff -urN squidGuard-1.4.orig/src/sgDiv.c.in squidGuard-1.4.upgraded/src/sgDiv.c.in ---- squidGuard-1.4.orig/src/sgDiv.c.in 2013-12-11 17:42:15.000000000 +1300 -+++ squidGuard-1.4.upgraded/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"); Index: files/patch-src__main.c =================================================================== --- files/patch-src__main.c +++ files/patch-src__main.c @@ -1,6 +1,6 @@ ---- src/main.c.orig Thu Jun 14 01:56:54 2001 -+++ src/main.c Sun Jan 1 17:04:13 2006 -@@ -108,7 +108,11 @@ +--- src/main.c.orig 2008-08-30 10:27:41 UTC ++++ src/main.c +@@ -114,7 +114,11 @@ int main(argc, argv, envp) globalUpdate = 1; break; case 'v': @@ -12,3 +12,52 @@ exit(0); break; case 't': +@@ -175,7 +179,7 @@ int main(argc, argv, envp) + sgReloadConfig(); + } + if(failsafe_mode) { +- puts(""); ++ puts("ERR message=\"squidGuard failsafe mode\""); + fflush(stdout); + if(sig_hup){ + sgReloadConfig(); +@@ -184,7 +188,7 @@ int main(argc, argv, envp) + } + 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 +200,14 @@ int main(argc, argv, envp) + 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 +219,10 @@ int main(argc, argv, envp) + 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; + } Index: files/patch-src__sgDiv.c =================================================================== --- files/patch-src__sgDiv.c +++ files/patch-src__sgDiv.c @@ -0,0 +1,11 @@ +--- src/sgDiv.c.orig 2008-03-12 20:41:53 UTC ++++ src/sgDiv.c +@@ -771,7 +771,7 @@ void sgEmergency () + } + sgLogError("Going into emergency mode"); + while(fgets(buf, MAX_BUF, stdin) != NULL){ +- puts(""); ++ puts("ERR"); + fflush(stdout); + } + sgLogError("ending emergency mode, stdin empty"); Index: files/patch-src__sgDiv.c.in =================================================================== --- files/patch-src__sgDiv.c.in +++ files/patch-src__sgDiv.c.in @@ -9,3 +9,12 @@ p++; break; default: +@@ -782,7 +782,7 @@ void sgEmergency () + } + sgLogError("Going into emergency mode"); + while(fgets(buf, MAX_BUF, stdin) != NULL){ +- puts(""); ++ puts("ERR"); + fflush(stdout); + } + sgLogError("ending emergency mode, stdin empty");