Browse code

SPF checking no longer experimentalSPF checking no longer experimental

git-svn: trunk@3166

Nigel Horne authored on 2007/08/09 20:25:43
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Thu Aug  9 11:26:02 BST 2007 (njh)
2
+----------------------------------
3
+  * libclamav/pdf.c:	Bug 608
4
+  * clamav-milter:	SPF checking no longer experimental
5
+
1 6
 Wed Aug  8 19:26:30 CEST 2007 (edwin)
2 7
 ----------------------------------
3 8
   * libclamav/phishcheck.c: workaround Solaris problem with regexec() [bb
... ...
@@ -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-030807"
36
+#define	CM_VERSION	"devel-090807"
37 37
 
38 38
 #if HAVE_CONFIG_H
39 39
 #include "clamav-config.h"
... ...
@@ -283,7 +283,7 @@ struct	privdata {
283 283
 				 * looks like the remote end is playing ping
284 284
 				 * pong with us
285 285
 				 */
286
-#if	defined(HAVE_RESOLV_H) && defined(CL_EXPERIMENTAL)
286
+#ifdef	HAVE_RESOLV_H
287 287
 	unsigned	int	spf_ok:1;
288 288
 #endif
289 289
 	int	statusCount;	/* number of X-Virus-Status headers */
... ...
@@ -567,11 +567,9 @@ static	int	isBlacklisted(const char *ip_address);
567 567
 static	table_t	*mx(const char *host, table_t *t);
568 568
 #ifdef	HAVE_RESOLV_H
569 569
 static	table_t	*resolve(const char *host, table_t *t);
570
-#ifdef	CL_EXPERIMENTAL
571 570
 static	int	spf(struct privdata *privdata, table_t *prevhosts);
572 571
 static	void	spf_ip(char *ip, int zero, void *v);
573 572
 #endif
574
-#endif
575 573
 static	sfsistat	black_hole(const struct privdata *privdata);
576 574
 static	int	useful_header(const char *cmd);
577 575
 
... ...
@@ -1190,7 +1188,8 @@ main(int argc, char **argv)
1190 1190
 				perror(cpt->strarg);
1191 1191
 			else
1192 1192
 				cli_dbgmsg(_("Running as user %s (UID %d, GID %d)\n"),
1193
-					cpt->strarg, user->pw_uid, user->pw_gid);
1193
+					cpt->strarg, (int)user->pw_uid,
1194
+					(int)user->pw_gid);
1194 1195
 		} else if(!black_hole_mode)
1195 1196
 			fprintf(stderr, _("%s: running as root is not recommended (check \"User\" in %s)\n"), argv[0], cfgfile);
1196 1197
 
... ...
@@ -3445,7 +3444,7 @@ clamfi_eom(SMFICTX *ctx)
3445 3445
 	 * TODO: it would be useful to add a header if mbox.c/FOLLOWURLS was
3446 3446
 	 * exceeded
3447 3447
 	 */
3448
-#if	defined(HAVE_RESOLV_H) && defined(CL_EXPERIMENTAL)
3448
+#ifdef	HAVE_RESOLV_H
3449 3449
 	if((strstr(mess, "FOUND") != NULL) && (strstr(mess, "Phishing") != NULL)) {
3450 3450
 		table_t *prevhosts = tableCreate();
3451 3451
 
... ...
@@ -6099,7 +6098,6 @@ resolve(const char *host, table_t *t)
6099 6099
 	return t;
6100 6100
 }
6101 6101
 
6102
-#ifdef	CL_EXPERIMENTAL
6103 6102
 /*
6104 6103
  * Validate SPF records to help to stop Phish false positives
6105 6104
  * http://www.openspf.org/SPF_Record_Syntax
... ...
@@ -6338,8 +6336,6 @@ spf_ip(char *ip, int zero, void *v)
6338 6338
 	}
6339 6339
 }
6340 6340
 
6341
-#endif	/*CL_EXPERIMENTAL*/
6342
-
6343 6341
 #else	/*!HAVE_RESOLV_H */
6344 6342
 static void
6345 6343
 mx(void)
... ...
@@ -624,8 +624,16 @@ flatedecode(unsigned char *buf, off_t len, int fout, const cli_ctx *ctx)
624 624
 
625 625
 					nbytes += cli_writen(fout, output, sizeof(output));
626 626
 
627
+					/*
628
+					 * BLOCKMAX is on if ArchiveBlockMax
629
+					 *	is set in clamd.conf
630
+					 *
631
+					 * Bug 608 Michael Brennen
632
+					 *	<michael@fishnet.us>
633
+					 */
627 634
 					if(ctx->limits &&
628 635
 					   ctx->limits->maxfilesize &&
636
+					   BLOCKMAX &&
629 637
 					   (nbytes > (off_t) ctx->limits->maxfilesize)) {
630 638
 						cli_dbgmsg("cli_pdf: flatedecode size exceeded (%lu)\n",
631 639
 							(unsigned long)nbytes);