Browse code

Enable SESSION by default

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

Nigel Horne authored on 2005/01/31 00:19:21
Showing 3 changed files
... ...
@@ -1,3 +1,12 @@
1
+Sun Jan 30 15:18:02 GMT 2005 (njh)
2
+----------------------------------
3
+  * clamav-milter:	SESSION is on now by default, to test clamd
4
+			PACKADDR is now uses unsinged to remove warning on
5
+				Sun's C compiler, patch by
6
+				"Dugal James P." <jpd@louisiana.edu>
7
+			Don't check compatibility with sendmail.cf if sendmail
8
+				is running on a different machine
9
+
1 10
 Fri Jan 28 22:44:17 CET 2005 (tk)
2 11
 ---------------------------------
3 12
   * docs/MacOSX: updated (Dale Enterprise L.L.C)
... ...
@@ -663,6 +663,12 @@ Changes
663 663
 0.81d	28/1/05:	Some error messages still talked about --internal
664 664
 			Scanmail not set warning is now only given if
665 665
 				DisableDefaultScanOptions is set
666
+0.81e	30/1/05:	Don't check compatibility with sendmail.cf if sendmail
667
+				is running on a different machine
668
+			PACKADDR is now uses unsinged to remove warning on
669
+				Sun's C compiler, patch by
670
+				"Dugal James P." <jpd@louisiana.edu>
671
+			SESSION is back on by default, to test clamd fix
666 672
 
667 673
 INTERNATIONALISATION
668 674
 
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * Change History:
28 28
  * $Log: clamav-milter.c,v $
29
+ * Revision 1.174  2005/01/30 15:16:30  nigelhorne
30
+ * Enable SESSION by default
31
+ *
29 32
  * Revision 1.173  2005/01/28 08:49:04  nigelhorne
30 33
  * Fixed --internal warnings that should refer to --external
31 34
  *
... ...
@@ -530,9 +533,9 @@
530 530
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
531 531
  * Added -f flag use MaxThreads if --max-children not set
532 532
  */
533
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.173 2005/01/28 08:49:04 nigelhorne Exp $";
533
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.174 2005/01/30 15:16:30 nigelhorne Exp $";
534 534
 
535
-#define	CM_VERSION	"0.81d"
535
+#define	CM_VERSION	"0.81e"
536 536
 
537 537
 #if HAVE_CONFIG_H
538 538
 #include "clamav-config.h"
... ...
@@ -631,7 +634,7 @@ typedef	unsigned int	in_addr_t;
631 631
 
632 632
 #define	VERSION_LENGTH	128
633 633
 
634
-/*#define	SESSION	/*
634
+#define	SESSION	/*
635 635
 		 * Keep one command connection open to clamd, otherwise a new
636 636
 		 * command connection is created for each new email
637 637
 		 *
... ...
@@ -679,7 +682,7 @@ typedef struct header_list_struct *header_list_t;
679 679
  *
680 680
  * TODO: read this table in from a file (clamd.conf?)
681 681
  */
682
-#define PACKADDR(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
682
+#define PACKADDR(a, b, c, d) (((uint32_t)(a) << 24) | ((b) << 16) | ((c) << 8) | (d))
683 683
 #define MAKEMASK(bits)	((uint32_t)(0xffffffff << (bits)))
684 684
 
685 685
 static const struct cidr_net {
... ...
@@ -852,7 +855,7 @@ static	int	logClean = 1;	/*
852 852
 static	char	*signature = N_("-- \nScanned by ClamAv - http://www.clamav.net\n");
853 853
 static	time_t	signatureStamp;
854 854
 static	char	*templatefile;	/* e-mail to be sent when virus detected */
855
-static	char	*tmpdir;
855
+static	const char	*tmpdir;
856 856
 
857 857
 #ifdef	CL_DEBUG
858 858
 static	int	debug_level = 0;
... ...
@@ -5073,6 +5076,12 @@ verifyIncomingSocketName(const char *sockName)
5073 5073
 	size_t size;
5074 5074
 	struct stat statb;
5075 5075
 
5076
+	if(strncmp(sockName, "inet:", 5) == 0)
5077
+		/*
5078
+		 * clamav-milter is running on a different machine from sendmail
5079
+		 */
5080
+		return 1;
5081
+
5076 5082
 	fd = open("/etc/mail/sendmail.cf", O_RDONLY);
5077 5083
 
5078 5084
 	if(fd < 0)