Browse code

HP-UX doesn't have EX_CONFIG

git-svn: trunk@3162

Nigel Horne authored on 2007/07/19 21:06:52
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Thu Jul 19 12:13:33 BST 2007 (njh)
2
+----------------------------------
3
+  * clamav-milter/clamav-milter.c:	HP-UX doesn't have EX_CONFIG, repoted
4
+				by clam * ministry.se
5
+
1 6
 Tue Jul 17 11:41:31 BST 2007 (trog)
2 7
 -----------------------------------
3 8
   * libclamav/unarj.c: fix include
... ...
@@ -33,7 +33,7 @@
33 33
  */
34 34
 static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.312 2007/02/12 22:24:21 njh Exp $";
35 35
 
36
-#define	CM_VERSION	"devel-160707"
36
+#define	CM_VERSION	"devel-190707"
37 37
 
38 38
 #if HAVE_CONFIG_H
39 39
 #include "clamav-config.h"
... ...
@@ -167,6 +167,10 @@ typedef	unsigned int	in_addr_t;
167 167
 #endif
168 168
 #endif
169 169
 
170
+#ifndef	EX_CONFIG	/* HP-UX */
171
+#define	EX_CONFIG	78
172
+#endif
173
+
170 174
 #define	VERSION_LENGTH	128
171 175
 #define	DEFAULT_TIMEOUT	120
172 176
 #define	NTRIES	30	/* How long to wait for the local clamd to start */
... ...
@@ -5118,11 +5122,11 @@ isLocal(const char *addr)
5118 5118
 			int match = 1;
5119 5119
 			int j;
5120 5120
 
5121
-			for(j = 0; match && j < pnet6->preflen >> 3; j++)
5121
+			for(j = 0; match && j < (pnet6->preflen >> 3); j++)
5122 5122
 				if(pnet6->base.s6_addr[j] != ip6.s6_addr[j])
5123 5123
 					match = 0;
5124 5124
 			if(match && (j < 16)) {
5125
-				uint8_t mask = 0xff << (8 - (pnet6->preflen & 7));
5125
+				uint8_t mask = (uint8_t)(0xff << (8 - (pnet6->preflen & 7)) & 0xFF);
5126 5126
 
5127 5127
 				if((pnet6->base.s6_addr[j] & mask) != (ip6.s6_addr[j] & mask))
5128 5128
 					match = 0;
... ...
@@ -6207,7 +6211,7 @@ spf(struct privdata *privdata, table_t *prevhosts)
6207 6207
 			p += len;
6208 6208
 			continue;
6209 6209
 		}
6210
-		strncpy(txt, &p[1], sizeof(txt) - 1);
6210
+		strncpy(txt, (const char *)&p[1], sizeof(txt) - 1);
6211 6211
 		txt[len - 1] = '\0';
6212 6212
 		if((strncmp(txt, "v=spf1 ", 7) == 0) || (strncmp(txt, "spf2.0/pra ", 11) == 0)) {
6213 6213
 			int j;
... ...
@@ -6310,7 +6314,7 @@ spf(struct privdata *privdata, table_t *prevhosts)
6310 6310
 					if(*inchost &&
6311 6311
 					   (strcmp(inchost, host) != 0) &&
6312 6312
 					   (tableFind(prevhosts, inchost) == -1)) {
6313
-						const char *real_from = privdata->from;
6313
+						char *real_from = privdata->from;
6314 6314
 						privdata->from = cli_malloc(strlen(inchost) + 3);
6315 6315
 						sprintf(privdata->from, "n@%s", inchost);
6316 6316
 						tableInsert(prevhosts, host, 0);