changeset 98:91c27c00048f

tokenizer errors now go thru syslog to be visible during config file reloads in normal operation
author carl
date Thu, 22 Sep 2005 21:57:08 -0700
parents cc3b79349c9c
children f8963ddf7143
files ChangeLog dnsbl.spec.in package.bash src/tokenizer.cpp xml/dnsbl.in
diffstat 5 files changed, 597 insertions(+), 585 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 21 13:29:28 2005 -0700
+++ b/ChangeLog	Thu Sep 22 21:57:08 2005 -0700
@@ -1,5 +1,9 @@
     $Id$
 
+5.6 2005-09-22
+    Tokenizer errors now go thru the syslog code, so they are visible
+    when generated during config file reloads during normal operation.
+
 5.5 2005-09-21
     Cleanup debug logging.  Verify from/to pairs now remembers the last
     from value sent to the remote server to prevent unnecessary rset
--- a/dnsbl.spec.in	Wed Sep 21 13:29:28 2005 -0700
+++ b/dnsbl.spec.in	Thu Sep 22 21:57:08 2005 -0700
@@ -1,6 +1,6 @@
 Summary: DNSBL Sendmail Milter
 Name: dnsbl
-Version: 5.5
+Version: 5.6
 Release: 2
 Copyright: GPL
 Group: System Environment/Daemons
--- a/package.bash	Wed Sep 21 13:29:28 2005 -0700
+++ b/package.bash	Thu Sep 22 21:57:08 2005 -0700
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-VER=dnsbl-5.5
+VER=dnsbl-5.6
 mkdir $VER
     target1=/home/httpd/html/510sg/util/dnsbl.tar.gz
     target2=/home/httpd/html/510sg/dnsbl.conf
--- a/src/tokenizer.cpp	Wed Sep 21 13:29:28 2005 -0700
+++ b/src/tokenizer.cpp	Thu Sep 22 21:57:08 2005 -0700
@@ -6,10 +6,12 @@
 
 */
 
-#include "dnsbl.h"
+#include "includes.h"
 
 static char* tokenizer_version="$Id$";
 
+const int maxlen = 1000;	// used for snprintf buffers
+
 enum state {s_init,
             s_token,
             s_string,
@@ -342,13 +344,13 @@
 bool TOKEN::include(char *fn) {
     string_set::iterator i = filenamess.find(fn);
     if (i != filenamess.end()) {
-        my_syslog("redundant or recursive include file detected");
+		token_error("redundant or recursive include file detected");
         return false;
     }
     ifstream *is = new ifstream;
     is->open(fn);
     if (is->fail()) {
-        char buf[1000];
+		char buf[maxlen];
         snprintf(buf, sizeof(buf), "include file %s not found", fn);
         token_error(buf);
         return false;
@@ -486,18 +488,24 @@
 
 void TOKEN::token_error(const char *err) {
     token_error();
-    printf("%s \n", err);
+	char buf[maxlen];
+	snprintf(buf, sizeof(buf), "%s \n", err);
+	my_syslog(buf);
 }
 
 
 void TOKEN::token_error(const char *fmt, int d, const char *s) {
-    printf(fmt, d, s);
+	char buf[maxlen];
+	snprintf(buf, sizeof(buf), fmt, d, s);
+	my_syslog(buf);
 }
 
 
 void TOKEN::token_error(const char *fmt, const char *t, const char *h) {
     if (!h) h = "null";
-    printf(fmt, t, h);
+	char buf[maxlen];
+	snprintf(buf, sizeof(buf), fmt, t, h);
+	my_syslog(buf);
 }
 
 
--- a/xml/dnsbl.in	Wed Sep 21 13:29:28 2005 -0700
+++ b/xml/dnsbl.in	Thu Sep 22 21:57:08 2005 -0700
@@ -2,7 +2,7 @@
 
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
-<title>DNSBL Sendmail milter - Version 5.5</title>
+<title>DNSBL Sendmail milter - Version 5.6</title>
 </head>
 
 <center>Introduction</center>