changeset 46:66c66a6ee65f

changes for 3.2
author carl
date Fri, 09 Jul 2004 08:16:25 -0700
parents 2eef08791e11
children 71252053d258
files install.bash src/dnsbl.cpp
diffstat 2 files changed, 29 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/install.bash	Fri Jul 09 08:04:25 2004 -0700
+++ b/install.bash	Fri Jul 09 08:16:25 2004 -0700
@@ -44,6 +44,13 @@
 if [ ! -f $DST/tld.conf ]; then
     cp tld.conf $DST
 fi
+
+# make the directory for the socket
+mkdir -p          /var/run/dnsbl
+chown dnsbl:dnsbl /var/run/dnsbl
+chmod 700         /var/run/dnsbl
+
+# install the binaries
 mv -f dnsbl /usr/sbin/dnsbl
 cp dnsbl.rc /etc/rc.d/init.d/dnsbl
 chmod 755 /etc/rc.d/init.d/dnsbl
--- a/src/dnsbl.cpp	Fri Jul 09 08:04:25 2004 -0700
+++ b/src/dnsbl.cpp	Fri Jul 09 08:16:25 2004 -0700
@@ -906,11 +906,11 @@
     if (dc.content_suffix) {
         fprintf(stdout, "\ncontent filtering enabled with %s %s\n", dc.content_suffix, dc.content_message);
     }
-    if (dc.host_limit) {
-        fprintf(stdout, "\ncontent filtering for host names enabled with limit %d %s\n", dc.host_limit, dc.host_limit_message);
+    if (dc.host_limit && !dc.host_random) {
+        fprintf(stdout, "\ncontent filtering for host names hard limit %d %s\n", dc.host_limit, dc.host_limit_message);
     }
-    if (dc.host_random) {
-        fprintf(stdout, "\nrandom selection of host names, host limit message is not used\n");
+    if (dc.host_limit && dc.host_random) {
+        fprintf(stdout, "\ncontent filtering for host names soft limit %d\n", dc.host_limit);
     }
     if (dc.tag_limit) {
         fprintf(stdout, "\ncontent filtering for excessive html tags enabled with limit %d %s\n", dc.tag_limit, dc.tag_limit_message);
@@ -1024,11 +1024,11 @@
     }
     dc.config_files.push_back(fn);
     map<char*, int, ltstr> commands;
-    enum {dummy, tld, content, hostlimit, hostrandom, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};
+    enum {dummy, tld, content, hostlimit, hostslimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};
     commands["tld"        ] = tld;
     commands["content"    ] = content;
     commands["host_limit" ] = hostlimit;
-    commands["host_random"] = hostrandom;
+    commands["host_soft_limit"] = hostslimit;
     commands["html_limit" ] = htmllimit;
     commands["html_tag"   ] = htmltag;
     commands["dnsbl"      ] = dnsbl;
@@ -1091,10 +1091,14 @@
                     *last = '\0';                               // make it a null terminator
                     dc.host_limit         = atoi(limit);
                     dc.host_limit_message = register_string(msg);
+                    dc.host_random        = false;
                     processed = true;
                     } break;
 
-                case hostrandom: {
+                case hostslimit: {
+                    char *limit = next_token(delim);
+                    if (!limit) break;                          // no integer limit
+                    dc.host_limit  = atoi(limit);
                     dc.host_random = true;
                     processed = true;
                     } break;