Browse code

Ensure --max-children > 0 in LocalSocket mode with SESSIONS

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

Nigel Horne authored on 2004/12/20 02:04:03
Showing 3 changed files
... ...
@@ -1,3 +1,10 @@
1
+Sun Dec 19 17:01:56 GMT 2004 (njh)
2
+----------------------------------
3
+  * clamav-milter: Correctly warn that --max_childen must be given in SESSION
4
+		mode if LocalSocket is used and MaxThreads isn't given in
5
+		clamd.conf. max_children is needed to know how many sessions
6
+		to initiate to clamd(s)
7
+
1 8
 Sun Dec 19 13:51:20 GMT 2004 (njh)
2 9
 ----------------------------------
3 10
   * libclamav/mbox.c:	Further work on the non-parsing version.
... ...
@@ -618,6 +618,8 @@ Changes
618 618
 0.80cc	13/12/04:	Fix crash on FreeBSD if DNS has been incorrectly set up
619 619
 		Mutex the version strings
620 620
 0.80dd	19/12/04:	Tidy up non SESSION code
621
+0.80ee	19/12/04:	Error didn't appear in SESSIONS mode if LocalSocket set
622
+		and neither max-children nor MaxThreads is set.
621 623
 
622 624
 INTERNATIONALISATION
623 625
 
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * Change History:
28 28
  * $Log: clamav-milter.c,v $
29
+ * Revision 1.165  2004/12/19 17:00:28  nigelhorne
30
+ * Ensure --max-children > 0 in LocalSocket mode with SESSIONS
31
+ *
29 32
  * Revision 1.164  2004/12/19 13:49:28  nigelhorne
30 33
  * Fix non SESSION compilation error
31 34
  *
... ...
@@ -503,9 +506,9 @@
503 503
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
504 504
  * Added -f flag use MaxThreads if --max-children not set
505 505
  */
506
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.164 2004/12/19 13:49:28 nigelhorne Exp $";
506
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.165 2004/12/19 17:00:28 nigelhorne Exp $";
507 507
 
508
-#define	CM_VERSION	"0.80dd"
508
+#define	CM_VERSION	"0.80ee"
509 509
 
510 510
 #if HAVE_CONFIG_H
511 511
 #include "clamav-config.h"
... ...
@@ -1634,6 +1637,14 @@ main(int argc, char **argv)
1634 1634
 			clamav_version = strdup(version);
1635 1635
 		}
1636 1636
 	} else {
1637
+		/*
1638
+		 * We need to know how many connections to establish to clamd
1639
+		 */
1640
+		if(max_children == 0) {
1641
+			fprintf(stderr, _("%s: --max-children must be given in sessions mode\n"), argv[0]);
1642
+			return EX_CONFIG;
1643
+		}
1644
+
1637 1645
 		clamav_versions = (char **)cli_malloc(max_children * sizeof(char *));
1638 1646
 		if(clamav_versions == NULL)
1639 1647
 			return EX_TEMPFAIL;