Browse code

Config file has changed

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@462 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/04/01 05:48:59
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Mar 31 22:00:05 BST 2004 (njh)
2
+----------------------------------
3
+  * clamav-milter:	Handle new location of config file parser
4
+
1 5
 Wed Mar 31 18:12:20 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav: Code tidy up - free memory earlier
... ...
@@ -300,6 +300,8 @@ Changes
300 300
 		out when the remote end (the end talking to
301 301
 		sendmail) is slow
302 302
 		Prefer cli_dbgmsg/cli_warnmsg over printf
303
+0.70d	29/3/04	Print the sendmail ID with the virus note in syslog
304
+		config file location has changed
303 305
 
304 306
 BUG REPORTS
305 307
 
... ...
@@ -299,9 +299,14 @@
299 299
  *			for timing out when the remote end (the end talking to
300 300
  *			sendmail) is slow
301 301
  *			Prefer cli_dbgmsg/cli_warnmsg over printf
302
+ *	0.70d	29/3/04	Print the sendmail ID with the virus note in syslog
303
+ *			config file location has changed
302 304
  *
303 305
  * Change History:
304 306
  * $Log: clamav-milter.c,v $
307
+ * Revision 1.66  2004/03/31 20:48:03  nigelhorne
308
+ * Config file has changed
309
+ *
305 310
  * Revision 1.65  2004/03/27 21:44:21  nigelhorne
306 311
  * Attempt to handle clamd quick timeout for slow remote sites
307 312
  *
... ...
@@ -482,9 +487,9 @@
482 482
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
483 483
  * Added -f flag use MaxThreads if --max-children not set
484 484
  */
485
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.65 2004/03/27 21:44:21 nigelhorne Exp $";
485
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.66 2004/03/31 20:48:03 nigelhorne Exp $";
486 486
 
487
-#define	CM_VERSION	"0.70c"
487
+#define	CM_VERSION	"0.70d"
488 488
 
489 489
 /*#define	CONFDIR	"/usr/local/etc"*/
490 490
 
... ...
@@ -493,7 +498,7 @@ static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.65 2004/03/27 21:44:21 nig
493 493
 #endif
494 494
 
495 495
 #include "defaults.h"
496
-#include "cfgfile.h"
496
+#include "cfgparser.h"
497 497
 #include "../target.h"
498 498
 #include "str.h"
499 499
 #include "../libclamav/others.h"
... ...
@@ -680,6 +685,7 @@ static	int	cl_error = SMFIS_TEMPFAIL; /*
680 680
 static	int	threadtimeout = CL_DEFAULT_SCANTIMEOUT; /*
681 681
 				 * number of seconds to wait for clamd to
682 682
 				 * respond
683
+				 * TODO: consider changing to ReadTimeout
683 684
 				 */
684 685
 static	int	logClean = 1;	/*
685 686
 				 * Add clean items to the log file
... ...
@@ -1817,6 +1823,7 @@ clamfi_eom(SMFICTX *ctx)
1817 1817
 {
1818 1818
 	int rc = SMFIS_CONTINUE;
1819 1819
 	char *ptr;
1820
+	const char *sendmailId;
1820 1821
 	struct privdata *privdata = (struct privdata *)smfi_getpriv(ctx);
1821 1822
 	char mess[128];
1822 1823
 
... ...
@@ -1892,13 +1899,13 @@ clamfi_eom(SMFICTX *ctx)
1892 1892
 	close(privdata->cmdSocket);
1893 1893
 	privdata->cmdSocket = -1;
1894 1894
 
1895
-	if(strstr(mess, "ERROR") != NULL) {
1895
+	sendmailId = smfi_getsymval(ctx, "i");
1896 1896
 
1897
-		ptr = smfi_getsymval(ctx, "i");
1897
+	if(strstr(mess, "ERROR") != NULL) {
1898 1898
 
1899
-		cli_warnmsg("%s: %s\n", ptr, mess);
1899
+		cli_warnmsg("%s: %s\n", sendmailId, mess);
1900 1900
 		if(use_syslog)
1901
-			syslog(LOG_ERR, "%s: %s\n", ptr, mess);
1901
+			syslog(LOG_ERR, "%s: %s\n", sendmailId, mess);
1902 1902
 		clamfi_cleanup(ctx);
1903 1903
 		return cl_error;
1904 1904
 	}
... ...
@@ -1914,7 +1921,7 @@ clamfi_eom(SMFICTX *ctx)
1914 1914
 		if(use_syslog && logClean)
1915 1915
 			/* Include the sendmail queue ID in the log */
1916 1916
 			syslog(LOG_NOTICE, "%s: clean message from %s",
1917
-				smfi_getsymval(ctx, "i"),
1917
+				sendmailId,
1918 1918
 				(privdata->from) ? privdata->from : "an unknown sender");
1919 1919
 
1920 1920
 		if(privdata->body) {
... ...
@@ -1936,9 +1943,6 @@ clamfi_eom(SMFICTX *ctx)
1936 1936
 		int i;
1937 1937
 		char **to, *err;
1938 1938
 
1939
-		if(use_syslog)
1940
-			syslog(LOG_NOTICE, mess);
1941
-
1942 1939
 		/*
1943 1940
 		 * Setup err as a list of recipients
1944 1941
 		 */
... ...
@@ -1949,7 +1953,8 @@ clamfi_eom(SMFICTX *ctx)
1949 1949
 		 * length of privdata->from and may get a buffre overrun
1950 1950
 		 * causing a crash
1951 1951
 		 */
1952
-		snprintf(err, 1024, "Intercepted virus from %s to", privdata->from);
1952
+		snprintf(err, 1024, "Intercepted virus from %s to",
1953
+			privdata->from);
1953 1954
 
1954 1955
 		ptr = strchr(err, '\0');
1955 1956
 
... ...
@@ -1971,9 +1976,7 @@ clamfi_eom(SMFICTX *ctx)
1971 1971
 
1972 1972
 		if(use_syslog)
1973 1973
 			/* Include the sendmail queue ID in the log */
1974
-			syslog(LOG_NOTICE, "%s: %s",
1975
-				smfi_getsymval(ctx, "i"),
1976
-				err);
1974
+			syslog(LOG_NOTICE, "%s: %s %s", sendmailId, mess, err);
1977 1975
 #ifdef	CL_DEBUG
1978 1976
 		cli_dbgmsg("%s\n", err);
1979 1977
 #endif
... ...
@@ -2027,7 +2030,7 @@ clamfi_eom(SMFICTX *ctx)
2027 2027
 					 * information
2028 2028
 					 */
2029 2029
 					fprintf(sendmail, "The message %s sent from %s to\n\t",
2030
-						smfi_getsymval(ctx, "i"), from);
2030
+						sendmailId, from);
2031 2031
 				else
2032 2032
 					fprintf(sendmail, "A message sent from %s to\n\t",
2033 2033
 						from);