Browse code

make milter compile even without resolv.h - bb#1125

git-svn: trunk@4086

aCaB authored on 2008/08/05 20:27:36
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Aug  5 13:14:31 CEST 2008 (acab)
2
+------------------------------------
3
+  * clamav-milter: properly wrap dns stuff (again) - bb#1125
4
+
1 5
 Tue Aug  5 12:43:27 CEST 2008 (acab)
2 6
 ------------------------------------
3 7
   * clamav-milter: properly wrap dns stuff - bb#1125
... ...
@@ -580,17 +580,16 @@ static	int	verifyIncomingSocketName(const char *sockName);
580 580
 static	int	isWhitelisted(const char *emailaddress, int to);
581 581
 static	int	isBlacklisted(const char *ip_address);
582 582
 static	table_t	*mx(const char *host, table_t *t);
583
-#ifdef	HAVE_RESOLV_H
584
-static	table_t	*resolve(const char *host, table_t *t);
585
-static	int	spf(struct privdata *privdata, table_t *prevhosts);
586
-static	void	spf_ip(char *ip, int zero, void *v);
587
-#endif
588 583
 static	sfsistat	black_hole(const struct privdata *privdata);
589 584
 static	int	useful_header(const char *cmd);
590 585
 
591 586
 extern	short	logg_foreground;
592 587
 
593
-#if HAVE_RESOLV_H
588
+#ifdef HAVE_RESOLV_H
589
+static	table_t	*resolve(const char *host, table_t *t);
590
+static	int	spf(struct privdata *privdata, table_t *prevhosts);
591
+static	void	spf_ip(char *ip, int zero, void *v);
592
+
594 593
 res_state res_pool;
595 594
 uint8_t *res_pool_state;
596 595
 pthread_cond_t res_pool_cond = PTHREAD_COND_INITIALIZER;
... ...
@@ -1394,7 +1393,7 @@ main(int argc, char **argv)
1394 1394
 	if((max_children == 0) && ((cpt = cfgopt(copt, "MaxThreads")) != NULL))
1395 1395
 		max_children = cfgopt(copt, "MaxThreads")->numarg;
1396 1396
 
1397
-#if HAVE_RESOLV_H
1397
+#ifdef HAVE_RESOLV_H
1398 1398
 	/* allocate a pool of resolvers */
1399 1399
 	if(!(res_pool=cli_calloc(max_children+1, sizeof(*res_pool))))
1400 1400
 		return EX_OSERR;
... ...
@@ -2115,6 +2114,7 @@ main(int argc, char **argv)
2115 2115
 	logg(_("Starting %s\n"), clamav_version);
2116 2116
 	logg(_("*Debugging is on\n"));
2117 2117
 
2118
+#ifdef HAVE_RESOLV_H
2118 2119
 	if(!(_res.options&RES_INIT))
2119 2120
 		if(res_init() < 0) {
2120 2121
 			fprintf(stderr, "%s: Can't initialise the resolver\n",
... ...
@@ -2146,6 +2146,7 @@ main(int argc, char **argv)
2146 2146
 		}
2147 2147
 		tableIterate(blacklist, dump_blacklist, NULL);
2148 2148
 	}
2149
+#endif /* HAVE_RESOLV_H */
2149 2150
 
2150 2151
 #ifdef	SESSION
2151 2152
 	pthread_mutex_unlock(&version_mutex);
... ...
@@ -6609,13 +6610,14 @@ spf_ip(char *ip, int zero, void *v)
6609 6609
 }
6610 6610
 
6611 6611
 #else	/*!HAVE_RESOLV_H */
6612
-static void
6613
-mx(void)
6612
+static table_t *
6613
+mx(const char *host, table_t *t)
6614 6614
 {
6615 6615
 	logg(_("^MX peers will not be immune from being blacklisted"));
6616 6616
 
6617 6617
 	if(blacklist == NULL)
6618 6618
 		blacklist = tableCreate();
6619
+	return NULL;
6619 6620
 }
6620 6621
 #endif	/* HAVE_RESOLV_H */
6621 6622