Browse code

ThreadTimeout has been renamed ReadTimeout

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

Nigel Horne authored on 2004/04/02 00:35:46
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+Thu Apr  1 16:46:22 BST 2004 (njh)
2
+----------------------------------
3
+  * libclamav:	Stop gracefully if messageAddLine() fails
4
+  * clamav-milter:	ThreadTimeout has been replaced by ReadTimeout -
5
+  	clamav-milter now supports this
6
+
1 7
 Thu Apr  1 11:37:25 BST 2004 (trog)
2 8
 -----------------------------------
3 9
   * clamd: add writen() function for wrapping write()
... ...
@@ -302,6 +302,17 @@ Changes
302 302
 		Prefer cli_dbgmsg/cli_warnmsg over printf
303 303
 0.70d	29/3/04	Print the sendmail ID with the virus note in syslog
304 304
 		config file location has changed
305
+0.70e	1/4/04	Fix a remote possibility of a file descriptor leak
306
+		in PingServer() if clamd has died
307
+		Fix by Andrey J. Melnikoff (TEMHOTA) <temnota@kmv.ru>
308
+		Corrected some debug messages reported by
309
+		Sergey Y. Afonin <asy@kraft-s.ru>
310
+0.70f	1/4/04	Added auto-submitted header to messages generated here
311
+		Suggested by "Andrey J. Melnikoff (TEMHOTA)"
312
+		<temnota@kmv.ru>
313
+		Add advice that --quarantine-dir may improve
314
+		performance when LocalSocket is used
315
+		ThreadTimeout seems to have been changed to ReadTimeout
305 316
 
306 317
 BUG REPORTS
307 318
 
... ...
@@ -301,9 +301,23 @@
301 301
  *			Prefer cli_dbgmsg/cli_warnmsg over printf
302 302
  *	0.70d	29/3/04	Print the sendmail ID with the virus note in syslog
303 303
  *			config file location has changed
304
+ *	0.70e	1/4/04	Fix a remote possibility of a file descriptor leak
305
+ *			in PingServer() if clamd has died
306
+ *			Fix by Andrey J. Melnikoff (TEMHOTA) <temnota@kmv.ru>
307
+ *			Corrected some debug messages reported by
308
+ *			Sergey Y. Afonin <asy@kraft-s.ru>
309
+ *	0.70f	1/4/04	Added auto-submitted header to messages generated here
310
+ *			Suggested by "Andrey J. Melnikoff (TEMHOTA)"
311
+ *			<temnota@kmv.ru>
312
+ *			Add advice that --quarantine-dir may improve
313
+ *			performance when LocalSocket is used
314
+ *			ThreadTimeout seems to have been changed to ReadTimeout
304 315
  *
305 316
  * Change History:
306 317
  * $Log: clamav-milter.c,v $
318
+ * Revision 1.67  2004/04/01 15:34:00  nigelhorne
319
+ * ThreadTimeout has been renamed ReadTimeout
320
+ *
307 321
  * Revision 1.66  2004/03/31 20:48:03  nigelhorne
308 322
  * Config file has changed
309 323
  *
... ...
@@ -487,9 +501,9 @@
487 487
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
488 488
  * Added -f flag use MaxThreads if --max-children not set
489 489
  */
490
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.66 2004/03/31 20:48:03 nigelhorne Exp $";
490
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.67 2004/04/01 15:34:00 nigelhorne Exp $";
491 491
 
492
-#define	CM_VERSION	"0.70d"
492
+#define	CM_VERSION	"0.70f"
493 493
 
494 494
 /*#define	CONFDIR	"/usr/local/etc"*/
495 495
 
... ...
@@ -564,8 +578,7 @@ typedef	unsigned short	in_port_t;
564 564
  *	can use wall(1) in the VirusEvent entry in clamav.conf
565 565
  * TODO: build with libclamav.so rather than libclamav.a
566 566
  * TODO: bounce message should optionally be read from a file
567
- * TODO: Support ThreadTimeout, LogTime and Logfile from the conf
568
- *	 file
567
+ * TODO: Support LogTime and Logfile from the conf file
569 568
  * TODO: Warn if TCPAddr doesn't allow connection from us
570 569
  * TODO: Decide action (bounce, discard, reject etc.) based on the virus
571 570
  *	found. Those with faked addresses, such as SCO.A want discarding,
... ...
@@ -684,8 +697,7 @@ static	int	cl_error = SMFIS_TEMPFAIL; /*
684 684
 				 */
685 685
 static	int	threadtimeout = CL_DEFAULT_SCANTIMEOUT; /*
686 686
 				 * number of seconds to wait for clamd to
687
-				 * respond
688
-				 * TODO: consider changing to ReadTimeout
687
+				 * respond, see ReadTimeout in clamav.conf
689 688
 				 */
690 689
 static	int	logClean = 1;	/*
691 690
 				 * Add clean items to the log file
... ...
@@ -1054,11 +1066,11 @@ main(int argc, char **argv)
1054 1054
 	if((max_children == 0) && ((cpt = cfgopt(copt, "MaxThreads")) != NULL))
1055 1055
 		max_children = cpt->numarg;
1056 1056
 
1057
-	if((cpt = cfgopt(copt, "ThreadTimeout")) != NULL) {
1057
+	if((cpt = cfgopt(copt, "ReadTimeout")) != NULL) {
1058 1058
 		threadtimeout = cpt->numarg;
1059 1059
 
1060 1060
 		if(threadtimeout < 0) {
1061
-			fprintf(stderr, "%s: ThreadTimeout must not be negative in %s\n",
1061
+			fprintf(stderr, "%s: ReadTimeout must not be negative in %s\n",
1062 1062
 				argv[0], cfgfile);
1063 1063
 		}
1064 1064
 	}
... ...
@@ -1083,11 +1095,13 @@ main(int argc, char **argv)
1083 1083
 				cfgfile);
1084 1084
 			return EX_CONFIG;
1085 1085
 		}
1086
+		if(quarantine_dir == NULL)
1087
+			fprintf(stderr, "When using Localsocket in %s\nyou may improve performance if you use the --quarantine_dir option\n", cfgfile);
1088
+
1086 1089
 		umask(077);
1087 1090
 
1088 1091
 		serverIPs = (long *)cli_malloc(sizeof(long));
1089 1092
 		serverIPs[0] = inet_addr("127.0.0.1");
1090
-
1091 1093
 	} else if((cpt = cfgopt(copt, "TCPSocket")) != NULL) {
1092 1094
 		int i;
1093 1095
 
... ...
@@ -1292,6 +1306,7 @@ pingServer(int serverNumber)
1292 1292
 		}
1293 1293
 		if(connect(sock, (struct sockaddr *)&server, sizeof(struct sockaddr_in)) < 0) {
1294 1294
 			perror("connect");
1295
+			close(sock);
1295 1296
 			return 0;
1296 1297
 		}
1297 1298
 	}
... ...
@@ -1778,9 +1793,9 @@ clamfi_eoh(SMFICTX *ctx)
1778 1778
 	 * must be on the white list, so just accept the e-mail
1779 1779
 	 */
1780 1780
 	if(use_syslog)
1781
-		syslog(LOG_NOTICE, "clamfi_connect: ignoring whitelisted message");
1781
+		syslog(LOG_NOTICE, "clamfi_eoh: ignoring whitelisted message");
1782 1782
 #ifdef	CL_DEBUG
1783
-	cli_dbgmsg("clamfi_connect: not scanning outgoing messages\n");
1783
+	cli_dbgmsg("clamfi_eoh: not scanning outgoing messages\n");
1784 1784
 #endif
1785 1785
 	clamfi_cleanup(ctx);
1786 1786
 
... ...
@@ -2019,6 +2034,11 @@ clamfi_eom(SMFICTX *ctx)
2019 2019
 				if(!pflag)
2020 2020
 					for(to = privdata->to; *to; to++)
2021 2021
 						fprintf(sendmail, "Cc: %s\n", *to);
2022
+				/*
2023
+				 * Auto-submittied is still a draft, keep an
2024
+				 * eye on its format
2025
+				 */
2026
+				fputs("Auto-Submitted: auto-submitted (antivirus notify)\n", sendmail);
2022 2027
 				fputs("Subject: Virus intercepted\n\n", sendmail);
2023 2028
 
2024 2029
 				if(bflag)