diff options
author | martti <martti> | 2008-02-12 14:17:16 +0000 |
---|---|---|
committer | martti <martti> | 2008-02-12 14:17:16 +0000 |
commit | b2c5a06302086b459a8ed2a3e99eb4c2daa667e2 (patch) | |
tree | a294236c397747f982f3449db26578f930f87e52 /mail/clamav/patches | |
parent | 0693ed221f5c88c422420f034cc71a60a33656d4 (diff) | |
download | pkgsrc-b2c5a06302086b459a8ed2a3e99eb4c2daa667e2.tar.gz |
Updated mail/clamav to 0.92.1
* Fix pkg/36853 with patch from Christos Zoulas (patch-ba)
* Lots of bug fixes since 0.92
Diffstat (limited to 'mail/clamav/patches')
-rw-r--r-- | mail/clamav/patches/patch-ah | 12 | ||||
-rw-r--r-- | mail/clamav/patches/patch-ba | 111 |
2 files changed, 117 insertions, 6 deletions
diff --git a/mail/clamav/patches/patch-ah b/mail/clamav/patches/patch-ah index ed3d574aef9..63f8e978fa0 100644 --- a/mail/clamav/patches/patch-ah +++ b/mail/clamav/patches/patch-ah @@ -1,8 +1,8 @@ -$NetBSD: patch-ah,v 1.12 2007/12/18 08:16:11 martti Exp $ +$NetBSD: patch-ah,v 1.13 2008/02/12 14:17:16 martti Exp $ ---- clamav-milter/clamav-milter.c.orig 2007-12-13 00:41:25.000000000 +0200 -+++ clamav-milter/clamav-milter.c 2007-12-18 09:34:20.000000000 +0200 -@@ -3803,7 +3803,7 @@ +--- clamav-milter/clamav-milter.c.orig 2008-02-06 18:00:43.000000000 +0200 ++++ clamav-milter/clamav-milter.c 2008-02-12 16:03:08.000000000 +0200 +@@ -3801,7 +3801,7 @@ * the postmaster, so include * some useful information */ @@ -11,7 +11,7 @@ $NetBSD: patch-ah,v 1.12 2007/12/18 08:16:11 martti Exp $ sendmailId, privdata->from); else fprintf(sendmail, _("A message sent from %s to\n"), -@@ -3817,7 +3817,7 @@ +@@ -3815,7 +3815,7 @@ fprintf(sendmail, _("\nThe message in question has been quarantined as %s\n"), privdata->filename); if(hflag) { @@ -20,7 +20,7 @@ $NetBSD: patch-ah,v 1.12 2007/12/18 08:16:11 martti Exp $ smfi_getsymval(ctx, "j"), privdata->from, smfi_getsymval(ctx, "_")); fputs(_("For your information, the original message headers were:\n\n"), sendmail); -@@ -5000,7 +5000,7 @@ +@@ -4998,7 +4998,7 @@ cli_dbgmsg("qfile move '%s' to '%s'\n", privdata->filename, newname); if(move(privdata->filename, newname) < 0) { diff --git a/mail/clamav/patches/patch-ba b/mail/clamav/patches/patch-ba new file mode 100644 index 00000000000..01e2cc4ccbc --- /dev/null +++ b/mail/clamav/patches/patch-ba @@ -0,0 +1,111 @@ +$NetBSD: patch-ba,v 1.1 2008/02/12 14:17:16 martti Exp $ + +Fix pkg/36853 + +--- clamav-milter/clamav-milter.c.orig 2008-02-12 16:03:08.000000000 +0200 ++++ clamav-milter/clamav-milter.c 2008-02-12 16:04:59.000000000 +0200 +@@ -90,6 +90,9 @@ + #if HAVE_RESOLV_H + #include <arpa/nameser.h> /* for HEADER */ + #include <resolv.h> ++#if __RES >= 20030124 ++#define HAVE_BIND9 ++#endif + #endif + #ifdef HAVE_UNISTD_H + #include <unistd.h> +@@ -505,6 +508,20 @@ + #endif /*SESSION*/ + + static pthread_cond_t watchdog_cond = PTHREAD_COND_INITIALIZER; ++#ifndef HAVE_BIND9 ++static pthread_mutex_t res_mutex = PTHREAD_MUTEX_INITIALIZER; ++#define RES_QUERY(len, h, c, t, q, s) \ ++ do { \ ++ pthread_mutex_lock(&res_mutex); \ ++ len = res_query((h), (c), (t), (q), (s)); \ ++ pthread_mutex_unlock(&res_mutex); \ ++ } while (/*CONSTCOND*/0) ++#else ++static pthread_key_t res_key; ++#define RES_QUERY(len, h, c, t, q, s) \ ++ len = res_nquery((res_state)pthread_getspecific(res_key), \ ++ (h), (c), (t), (q), (s)) ++#endif + + #ifndef SHUT_RD + #define SHUT_RD 0 +@@ -2061,12 +2078,19 @@ + logg(_("Starting %s\n"), clamav_version); + logg(_("*Debugging is on\n")); + ++#ifndef HAVE_BIND9 + if(!(_res.options&RES_INIT)) + if(res_init() < 0) { + fprintf(stderr, "%s: Can't initialise the resolver\n", + argv[0]); + return EX_UNAVAILABLE; + } ++#else ++ if (pthread_key_create(&res_key, free)) { ++ perror("pthread_key_create"); ++ return EX_UNAVAILABLE; ++ } ++#endif + + if(blacklist_time) { + char name[MAXHOSTNAMELEN + 1]; +@@ -2577,6 +2601,18 @@ + int sock = s->sock; + struct sockaddr *server = (struct sockaddr *)s->server; + int server_index = s->server_index; ++#ifdef HAVE_BIND9 ++ res_state res = cli_calloc(1, sizeof(*res)); ++ if (pthread_setspecific(res_key, res)) { ++ perror("pthread_setspecific"); ++ free(res); ++ return NULL; ++ } ++ if (res_ninit(res) < 0) { ++ perror("res_ninit"); ++ return NULL; ++ } ++#endif + + if(last_failed_pings[server_index]) { + s->rc = 0; +@@ -6137,7 +6173,7 @@ + return NULL; + } + +- len = res_query(host, C_IN, T_MX, (u_char *)&q, sizeof(q)); ++ RES_QUERY(len, host, C_IN, T_MX, (u_char *)&q, sizeof(q)); + if(len < 0) + return t; /* Host has no MX records */ + +@@ -6206,7 +6242,7 @@ + if((host == NULL) || (*host == '\0')) + return t; + +- len = res_query(host, C_IN, T_A, (u_char *)&q, sizeof(q)); ++ RES_QUERY(len, host, C_IN, T_A, (u_char *)&q, sizeof(q)); + if(len < 0) + return t; /* Host has no A records */ + +@@ -6265,7 +6301,6 @@ + * an SPF system, we ONLY use SPF records to reduce phish false positives + * TODO: IPv6? + * TODO: cache queries? +- * TODO: check res_query is thread safe + * + * INPUT: prevhosts, a list of hosts already searched: stops include loops + * e.g. mercado.com includes medrcadosw.com which includes mercado.com, +@@ -6317,7 +6352,7 @@ + *ptr = '\0'; + + logg("*SPF query '%s'\n", host); +- len = res_query(host, C_IN, T_TXT, (u_char *)&q, sizeof(q)); ++ RES_QUERY(len, host, C_IN, T_TXT, (u_char *)&q, sizeof(q)); + if(len < 0) { + free(host); + return 0; /* Host has no TXT records */ |