network/squidGuard: Removed (upstream no longer maintained).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
addafc4f1e
commit
e496b9a89a
|
@ -1,2 +0,0 @@
|
|||
SquidGuard is a URL redirector software used to use blacklists with
|
||||
the proxy software Squid.
|
|
@ -1,14 +0,0 @@
|
|||
config() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
# If there's no config file by that name, mv it over:
|
||||
if [ ! -r $OLD ]; then
|
||||
mv $NEW $OLD
|
||||
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
||||
# toss the redundant copy
|
||||
rm $NEW
|
||||
fi
|
||||
# Otherwise, we leave the .new copy for the admin to consider...
|
||||
}
|
||||
|
||||
config etc/squidguard/squidguard.conf.new
|
|
@ -1,73 +0,0 @@
|
|||
--- 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");
|
|
@ -1,19 +0,0 @@
|
|||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
squidGuard: squidGuard (URL redirector)
|
||||
squidGuard:
|
||||
squidGuard: SquidGuard is a URL redirector software used to use blacklists with
|
||||
squidGuard: the proxy software Squid.
|
||||
squidGuard:
|
||||
squidGuard:
|
||||
squidGuard:
|
||||
squidGuard:
|
||||
squidGuard:
|
||||
squidGuard:
|
||||
squidGuard: Homepage: http://www.squidguard.org
|
|
@ -1,129 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Slackware build script for squidGuard
|
||||
|
||||
# Written by Niki Kovacs <info@microlinux.fr>
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM=squidGuard
|
||||
VERSION=${VERSION:-1.4}
|
||||
BUILD=${BUILD:-3}
|
||||
TAG=${TAG:-_SBo}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i486 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
|
||||
# the name of the created package would be, and then exit. This information
|
||||
# could be useful to other scripts.
|
||||
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
||||
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
# Fixes a buffer overflow problem and prevents squidGuard from going into
|
||||
# emergency mode when overlong URLs are encountered (they can be perfectly
|
||||
# legal).
|
||||
|
||||
# Fixes two bypass problems with URLs having a length closed to the defined
|
||||
# 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" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--with-sg-config=/etc/squidguard/squidguard.conf \
|
||||
--with-sg-logdir=/var/log/squidguard \
|
||||
--with-sg-dbhome=/var/lib/squidguard \
|
||||
--with-squiduser=nobody \
|
||||
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--htmldir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--build=$ARCH-slackware-linux
|
||||
|
||||
make
|
||||
make prefix=$PKG/usr install
|
||||
|
||||
mkdir -p $PKG/etc/squidguard
|
||||
mkdir -p $PKG/var/lib/squidguard
|
||||
mkdir -p $PKG/var/log/squidguard
|
||||
cat samples/sample.conf > $PKG/etc/squidguard/squidguard.conf.new
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a ANNOUNCE CHANGELOG CONFIGURATION COPYING FAQ GPL INSTALL ISSUES.txt \
|
||||
README* samples/ doc/{*.html,*.txt,*.gif} \
|
||||
$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|
|
@ -1,10 +0,0 @@
|
|||
PRGNAM="squidGuard"
|
||||
VERSION="1.4"
|
||||
HOMEPAGE="http://www.squidguard.org"
|
||||
DOWNLOAD="http://www.squidguard.org/Downloads/squidGuard-1.4.tar.gz"
|
||||
MD5SUM="de834150998c1386c30feae196f16b06"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES="squid"
|
||||
MAINTAINER="Niki Kovacs"
|
||||
EMAIL="info@microlinux.fr"
|
|
@ -1,69 +0,0 @@
|
|||
diff -Nur squidGuard-1.4.orig/src/sg.h.in squidGuard-1.4/src/sg.h.in
|
||||
--- squidGuard-1.4.orig/src/sg.h.in 2007-11-16 23:58:32.000000000 +0700
|
||||
+++ squidGuard-1.4/src/sg.h.in 2015-02-07 22:26:18.632797069 +0700
|
||||
@@ -73,7 +73,7 @@
|
||||
#define REQUEST_TYPE_REDIRECT 2
|
||||
#define REQUEST_TYPE_PASS 3
|
||||
|
||||
-#define MAX_BUF 4096
|
||||
+#define MAX_BUF 12288
|
||||
|
||||
#define DEFAULT_LOGFILE "squidGuard.log"
|
||||
#define WARNING_LOGFILE "squidGuard.log"
|
||||
diff -Nur squidGuard-1.4.orig/src/sgDiv.c.in squidGuard-1.4/src/sgDiv.c.in
|
||||
--- squidGuard-1.4.orig/src/sgDiv.c.in 2008-07-14 23:02:43.000000000 +0700
|
||||
+++ squidGuard-1.4/src/sgDiv.c.in 2015-02-07 22:26:18.632797069 +0700
|
||||
@@ -745,7 +745,7 @@
|
||||
p++;
|
||||
break;
|
||||
case 'u': /* Requested URL */
|
||||
- strcat(buf, req->orig);
|
||||
+ strncat(buf, req->orig, 2048);
|
||||
p++;
|
||||
break;
|
||||
default:
|
||||
diff -Nur squidGuard-1.4.orig/src/sgLog.c squidGuard-1.4/src/sgLog.c
|
||||
--- squidGuard-1.4.orig/src/sgLog.c 2007-11-16 23:58:32.000000000 +0700
|
||||
+++ squidGuard-1.4/src/sgLog.c 2015-02-07 22:26:39.122853889 +0700
|
||||
@@ -2,7 +2,7 @@
|
||||
By accepting this notice, you agree to be bound by the following
|
||||
agreements:
|
||||
|
||||
- This software product, squidGuard, is copyrighted (C) 1998-2007
|
||||
+ This software product, squidGuard, is copyrighted (C) 1998-2009
|
||||
by Christine Kronberg, Shalla Secure Services. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@@ -55,8 +55,8 @@
|
||||
char msg[MAX_BUF];
|
||||
va_list ap;
|
||||
VA_START(ap, format);
|
||||
- if(vsprintf(msg, format, ap) > (MAX_BUF - 1))
|
||||
- fprintf(stderr,"overflow in vsprintf (sgLog): %s",strerror(errno));
|
||||
+ if(vsnprintf(msg, MAX_BUF, format, ap) > (MAX_BUF - 1))
|
||||
+ fprintf(stderr,"overflow in vsnprintf (sgLog): %s",strerror(errno));
|
||||
va_end(ap);
|
||||
date = niso(0);
|
||||
if(globalDebug || log == NULL) {
|
||||
@@ -87,8 +87,8 @@
|
||||
char msg[MAX_BUF];
|
||||
va_list ap;
|
||||
VA_START(ap, format);
|
||||
- if(vsprintf(msg, format, ap) > (MAX_BUF - 1))
|
||||
- sgLogFatalError("overflow in vsprintf (sgLogError): %s",strerror(errno));
|
||||
+ if(vsnprintf(msg, MAX_BUF, format, ap) > (MAX_BUF - 1))
|
||||
+ sgLog(globalErrorLog, "overflow in vsnprintf (sgLogError): %s",strerror(errno));
|
||||
va_end(ap);
|
||||
sgLog(globalErrorLog,"%s",msg);
|
||||
}
|
||||
@@ -104,8 +104,8 @@
|
||||
char msg[MAX_BUF];
|
||||
va_list ap;
|
||||
VA_START(ap, format);
|
||||
- if(vsprintf(msg, format, ap) > (MAX_BUF - 1))
|
||||
- return;
|
||||
+ if(vsnprintf(msg, MAX_BUF, format, ap) > (MAX_BUF - 1))
|
||||
+ sgLog(globalErrorLog, "overflow in vsnprintf (sgLogError): %s",strerror(errno));
|
||||
va_end(ap);
|
||||
sgLog(globalErrorLog,"%s",msg);
|
||||
sgEmergency();
|
Loading…
Reference in New Issue