ALT Linux repositórios
Group :: Sistema/Servidores
RPM: dansguardian
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: dansguardian-2.12.0.3-alt.patch
Download
Download
.../lists/phraselists/badwords/weighted_russian | 129 +++++++++++++++++++++
configs/lists/weightedphraselist.in | 3 +-
data/scripts/systemv-init.in | 125 +++++++-------------
src/NaughtyFilter.cpp | 14 +--
src/downloadmanagers/fancy.cpp | 1 +
5 files changed, 184 insertions(+), 88 deletions(-)
diff --git a/configs/lists/phraselists/badwords/weighted_russian b/configs/lists/phraselists/badwords/weighted_russian
new file mode 100644
index 0000000..31cf5a7
--- /dev/null
+++ b/configs/lists/phraselists/badwords/weighted_russian
@@ -0,0 +1,129 @@
+#
+# Dutch Swear Words Weighted Phrases
+# Taken from swif.zip from dansguardian website
+#
+
+#listcategory: "Bad words (Russian)"
+#<UTF-8><1> #CharSet Identifier for Troubleshootin
+
+< ебать ><75
+< блять ><50>
+< хуй ><75>
+< пиздец ><75>
+< пизда ><50>
+< ебаный ><65>
+< ебнутый ><65>
+< ебанутый ><65>
+< ебнуть ><65>
+< объебать ><65>
+< объебаный ><65>
+< отъебать> <65>
+< заебал > <65>
+< заебать > <65>
+< поебать > <65>
+< нахуй ><65>
+< похуй ><65>
+< хуйня ><65>
+< хуевый ><65>
+< охуенный ><65>
+< охуел ><65>
+< охуеть ><65>
+< похуеть ><65>
+< бля ><65>
+< пизданутый ><65>
+< пиздануть ><65>
+< пизди ><65>
+< пиздану ><65>
+< пиздану ><65>
+< отпизженный ><65>
+< отпизженый ><65>
+< отпиздить ><65>
+< мудазвон ><30>
+< мудак ><30>
+< сука ><10>
+#
+# Dutch Swear Words Weighted Phrases
+# Taken from swif.zip from dansguardian website
+#
+
+#listcategory: "Bad words (Russian)"
+#<CP1251><1> #CharSet Identifier for Troubleshootin
+
+< ><75
+< ><50>
+< ><75>
+< ><75>
+< ><50>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< > <65>
+< > <65>
+< > <65>
+< > <65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><30>
+< ><30>
+< ><10>
+#
+# Dutch Swear Words Weighted Phrases
+# Taken from swif.zip from dansguardian website
+#
+
+#listcategory: "Bad words (Russian)"
+#<KOI8-R><1> #CharSet Identifier for Troubleshootin
+
+< ><75
+< ><50>
+< ><75>
+< ><75>
+< ><50>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< > <65>
+< > <65>
+< > <65>
+< > <65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><65>
+< ><30>
+< ><30>
+< ><10>
diff --git a/configs/lists/weightedphraselist.in b/configs/lists/weightedphraselist.in
index 74be72d..3d53829 100644
--- a/configs/lists/weightedphraselist.in
+++ b/configs/lists/weightedphraselist.in
@@ -70,6 +70,7 @@
.Include<@DGCONFDIR@/lists/phraselists/badwords/weighted_dutch>
.Include<@DGCONFDIR@/lists/phraselists/badwords/weighted_french>
.Include<@DGCONFDIR@/lists/phraselists/badwords/weighted_german> #ALPHA#
+.Include<@DGCONFDIR@/lists/phraselists/badwords/weighted_russian> #ALPHA#
.Include<@DGCONFDIR@/lists/phraselists/badwords/weighted_portuguese> #ALPHA#
.Include<@DGCONFDIR@/lists/phraselists/badwords/weighted_spanish> #ALPHA#
@@ -118,7 +119,7 @@
#.Include<@DGCONFDIR@/lists/phraselists/domainsforsale/weighted>
#.Include<@DGCONFDIR@/lists/phraselists/idtheft/weighted>
.Include<@DGCONFDIR@/lists/phraselists/malware/weighted> #BETA#
-.Include<@DGCONFDIR@/lists/phraselists/proxies/weighted>
+#.Include<@DGCONFDIR@/lists/phraselists/proxies/weighted>
#.Include<@DGCONFDIR@/lists/phraselists/translation/weighted>
#.Include<@DGCONFDIR@/lists/phraselists/upstreamfilter/weighted>
.Include<@DGCONFDIR@/lists/phraselists/warezhacking/weighted>
diff --git a/data/scripts/systemv-init.in b/data/scripts/systemv-init.in
index 9f26f35..65325ca 100644
--- a/data/scripts/systemv-init.in
+++ b/data/scripts/systemv-init.in
@@ -2,7 +2,7 @@
#
# Startup script for dansguardian
#
-# chkconfig: 35 92 8
+# chkconfig: - 92 8
# description: A web content filtering plugin for web \
# proxies, developed to filter using lists of \
# banned phrases, MIME types, filename \
@@ -17,107 +17,72 @@
# Should-Start:
# Required-Stop: squid
# Should-Stop:
-# Default-Start: 3 5
+# Default-Start: none
# Default-Stop: 0 1 2 6
# Short-Description: Dansguardian web content filter
# Description: Dansguardian web content filter
### END INIT INFO
# File includes changes by Thomas Jarosch
-function wait_for_pid()
-{
- local PID=$1
- local RET=0
-
- if [ $PID -eq 0 ] ; then
- return $RET
- fi
-
- # give 60 secs then KILL
- local COUNTDOWN=60
+. /etc/init.d/functions
+
+PROCESSNAME=dansguardian
+PIDFILE=/var/run/$PROCESSNAME.pid
+LOCKFILE=/var/lock/subsys/$PROCESSNAME
+
- while [ -d /proc/${PID} ] && [ $COUNTDOWN -gt 0 ] ; do
- sleep 1
- COUNTDOWN=$[$COUNTDOWN-1]
- done
+if [ ! -f "@DGBINDIR@/$PROCESSNAME" ] || [ ! -f "@DGCONFDIR@/dansguardian.conf" ];then
+ exit 0
+fi
- if [ -d /proc/${PID} ]; then
- COMMAND=`ps h -o command ${PID}`
- logger "dansguardian: timeout waiting for PID ${PID}: ${COMMAND}; sending SIGKILL"
- kill -KILL $PID >/dev/null 2>&1
- RET=1
- fi
-
- return $RET
+start()
+{
+ start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $PROCESSNAME
+ RETVAL=$?
+ return $RETVAL
}
-# See how we were called.
+stop()
+{
+ stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user dansguardian -- $PROCESSNAME
+ RETVAL=$?
+ return $RETVAL
+}
+
+restart()
+{
+ stop
+ start
+}
case "$1" in
start)
- if [ -f @DGBINDIR@/dansguardian ] &&
- [ -f @DGCONFDIR@/dansguardian.conf ]; then
- echo -n "Starting dansguardian: "
- if @DGBINDIR@/dansguardian 2> /dev/null; then
- echo -e "\\033[60G\c"
- echo -e "[ \\033[1;32m\c"
- echo -e "OK\c"
- echo -e "\\033[0;39m\c"
- echo " ]"
- [ -d /var/lock/subsys ] && touch /var/lock/subsys/dansguardian
- else
- echo -e "\\033[60G\c"
- echo -e "[ \\033[1;31m\c"
- echo -e "FAILED\c"
- echo -e "\\033[0;39m\c"
- echo " ]"
- fi
- fi
+ start
;;
stop)
- echo -n "Shutting down dansguardian: "
- WAITPID=0
- if [ -f @DGPIDDIR@/dansguardian.pid ] ; then
- WAITPID=`cat @DGPIDDIR@/dansguardian.pid`
- fi
- if @DGBINDIR@/dansguardian -q 2> /dev/null; then
- if wait_for_pid $WAITPID ; then
- echo -e "\\033[60G\c"
- echo -e "[ \\033[1;32m\c"
- echo -e "OK\c"
- echo -e "\\033[0;39m\c"
- echo " ]"
- else
- echo -e "\\033[60G\c"
- echo -e "[ \\033[1;31m\c"
- echo -e "FAILED\c"
- echo -e "\\033[0;39m\c"
- echo " ]"
- fi
- /bin/rm -f @DGPIDDIR@/dansguardian.pid
- /bin/rm -f /tmp/.dguardianipc
- [ -d /var/lock/subsys ] && /bin/rm -f /var/lock/subsys/dansguardian
- else
- echo -e "\\033[60G\c"
- echo -e "[ \\033[1;31m\c"
- echo -e "FAILED\c"
- echo -e "\\033[0;39m\c"
- echo " ]"
- fi
+ if [ -e "$LOCKFILE" ]; then
+ stop
+ fi
;;
restart)
- $0 stop
- $0 start
+ restart
;;
+condstop)
+ if [ -e "$LOCKFILE" ]; then
+ stop
+ fi
+ ;;
status)
- if [ -f @DGBINDIR@/dansguardian ]; then
- @DGBINDIR@/dansguardian -s
- fi
+ " $PROCESSNAME" -s
;;
-
+condrestart)
+ if [ -e "$LOCKFILE" ]; then
+ restart
+ fi
+ ;;
*)
- echo "Usage: $0 {start|stop|restart|status}" >&2
+ echo "Usage: $0 {start|stop|restart|condstop|condrestart|status}" >&2
;;
esac
diff --git a/src/NaughtyFilter.cpp b/src/NaughtyFilter.cpp
index c835d45..f9511f7 100644
--- a/src/NaughtyFilter.cpp
+++ b/src/NaughtyFilter.cpp
@@ -205,16 +205,16 @@ void NaughtyFilter::checkme(const char *rawbody, off_t rawbodylen, const String
#endif
for (i = 0; i < hexdecodedlen; i++) {
c = hexdecoded[i];
- if (c >= 'A' && c <= 'Z') {
- c = 'a' + c - 'A';
- }
- else if (c >= 192 && c <= 221) { // for accented chars
- c += 32; // 224 + c - 192
- } else {
+// if (c >= 'A' && c <= 'Z') {
+// c = 'a' + c - 'A';
+// }
+// else if (c >= 192 && c <= 221) { // for accented chars
+// c += 32; // 224 + c - 192
+// } else {
if (c == 13 || c == 9 || c == 10) {
c = 32; // convert all whitespace to a space
}
- }
+// }
bodylc[i] = c;
}
}
diff --git a/src/downloadmanagers/fancy.cpp b/src/downloadmanagers/fancy.cpp
index 91d0882..7fa6651 100644
--- a/src/downloadmanagers/fancy.cpp
+++ b/src/downloadmanagers/fancy.cpp
@@ -18,6 +18,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
+#include <stdio.h>
#include <iostream>
#include <cmath>
#include <cstdio>