summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2006-12-13 02:57:08 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2006-12-13 02:57:08 +0000
commit12035fe7720b346e2a8c4209fdb879a81a1f64b2 (patch)
treebee44367d47ecec834b0bb0f44b1e785bafbab6a /mail
parent- Mark as FORBIDDEN (diff)
- Fix SIGSEGV in amd64 using size_t instead of int. [1]
- res_state has to be initialized before calling res_ninit(). [2] - Where res_ndestroy() is available, when thread is destroyed, we need to call res_ndestroy() instead of res_nclose(), to free the resource which is allocated by the resolver internally. [2] - portlint(1) - Bump PORTREVISION PR: 105001 [1] Submitted by: Christophe Thil<chris___thil.de> [1], ume [2]
Notes
Notes: svn path=/head/; revision=179622
Diffstat (limited to 'mail')
-rw-r--r--mail/libspf2/Makefile4
-rw-r--r--mail/libspf2/files/patch-src__libspf2__spf_interpret.c13
-rw-r--r--mail/libspf2/files/patch-src_libspf2_spf__dns__resolv.c98
3 files changed, 101 insertions, 14 deletions
diff --git a/mail/libspf2/Makefile b/mail/libspf2/Makefile
index bf88eb6bb3d4..beb9c10084fd 100644
--- a/mail/libspf2/Makefile
+++ b/mail/libspf2/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libspf2
PORTVERSION= 1.2.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= mail
MASTER_SITES= http://www.libspf2.org/%SUBDIR%/
MASTER_SITE_SUBDIR= spf
@@ -17,7 +17,7 @@ COMMENT= Sender Rewriting Scheme 2 C Implementation
CONFLICTS= ${PORTNAME}-1.0.*
-INSTALLS_SHLIB= yes
+USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
diff --git a/mail/libspf2/files/patch-src__libspf2__spf_interpret.c b/mail/libspf2/files/patch-src__libspf2__spf_interpret.c
new file mode 100644
index 000000000000..b48e5d33d9b3
--- /dev/null
+++ b/mail/libspf2/files/patch-src__libspf2__spf_interpret.c
@@ -0,0 +1,13 @@
+--- src/libspf2/spf_interpret.c.orig Wed Dec 13 00:46:58 2006
++++ src/libspf2/spf_interpret.c Wed Dec 13 00:47:23 2006
+@@ -49,8 +49,8 @@
+ SPF_record_t *spf_record;
+ SPF_errcode_t err;
+ char *buf;
+- int buflen;
+- int len;
++ size_t buflen;
++ size_t len;
+
+ SPF_ASSERT_NOTNULL(spf_response);
+ spf_request = spf_response->spf_request;
diff --git a/mail/libspf2/files/patch-src_libspf2_spf__dns__resolv.c b/mail/libspf2/files/patch-src_libspf2_spf__dns__resolv.c
index f04ac013093f..896f0f60158f 100644
--- a/mail/libspf2/files/patch-src_libspf2_spf__dns__resolv.c
+++ b/mail/libspf2/files/patch-src_libspf2_spf__dns__resolv.c
@@ -1,28 +1,102 @@
---- src/libspf2/spf_dns_resolv.c.orig Wed Mar 2 22:59:01 2005
-+++ src/libspf2/spf_dns_resolv.c Wed Mar 2 23:01:06 2005
-@@ -77,7 +77,9 @@
+Index: src/libspf2/spf_dns_resolv.c
+diff -u -p src/libspf2/spf_dns_resolv.c.orig src/libspf2/spf_dns_resolv.c
+--- src/libspf2/spf_dns_resolv.c.orig Sat Feb 19 11:38:12 2005
++++ src/libspf2/spf_dns_resolv.c Mon Jul 31 14:02:57 2006
+@@ -71,13 +71,18 @@ typedef struct
+ # define SPF_h_errno h_errno
+ #endif
+
++#if HAVE_DECL_RES_NINIT
+ static pthread_once_t res_state_control = PTHREAD_ONCE_INIT;
+ static pthread_key_t res_state_key;
+
static void
SPF_dns_resolv_thread_term(void *arg)
{
-+#if HAVE_DECL_RES_NINIT
++#ifdef res_ndestroy
++ res_ndestroy( (struct __res_state *)arg );
++#else
res_nclose( (struct __res_state *)arg );
+#endif
free(arg);
}
-@@ -144,9 +146,15 @@
+@@ -86,6 +91,7 @@ SPF_dns_resolv_init_key()
+ {
+ pthread_key_create(&res_state_key, SPF_dns_resolv_thread_term);
+ }
++#endif
+
+
+ #if 0
+@@ -130,8 +136,10 @@ SPF_dns_resolv_lookup(SPF_dns_server_t *
+ int rdlen;
+ const u_char *rdata, *rdata_end;
+
++#if HAVE_DECL_RES_NINIT
+ void *res_spec;
+ struct __res_state *res_state;
++#endif
+
+ SPF_ASSERT_NOTNULL(spf_dns_server);
+
+@@ -140,10 +148,15 @@ SPF_dns_resolv_lookup(SPF_dns_server_t *
+ SPF_ASSERT_NOTNULL(spfhook);
+ #endif
+
++#if HAVE_DECL_RES_NINIT
+ res_spec = pthread_getspecific(res_state_key);
if (res_spec == NULL) {
res_state = (struct __res_state *)
malloc(sizeof(struct __res_state));
-+#if HAVE_DECL_RES_NINIT
++ if (res_state == NULL) {
++ SPF_error("Failed to call malloc()");
++ }
++ memset(res_state, 0, sizeof(*res_state));
if (res_ninit(res_state) != 0) {
SPF_error("Failed to call res_ninit()");
}
+@@ -152,6 +165,11 @@ SPF_dns_resolv_lookup(SPF_dns_server_t *
+ else {
+ res_state = (struct __res_state *)res_spec;
+ }
+#else
-+ if (res_init() != 0) {
-+ SPF_error("Failed to call res_init()");
-+ }
++ if ((_res.options & RES_INIT) == 0 && res_init() != 0) {
++ SPF_error("Failed to call res_init()");
++ }
+#endif
- pthread_setspecific(res_state_key, (void *)res_state);
- }
- else {
+
+ /*
+ * try resolving the name
+@@ -486,7 +504,9 @@ SPF_dns_resolv_new(SPF_dns_server_t *lay
+ SPF_dns_resolv_config_t *spfhook;
+ #endif
+
++#if HAVE_DECL_RES_NINIT
+ pthread_once(&res_state_control, SPF_dns_resolv_init_key);
++#endif
+
+ spf_dns_server = malloc(sizeof(SPF_dns_server_t));
+ if ( spf_dns_server == NULL )
+@@ -517,19 +537,19 @@ SPF_dns_resolv_new(SPF_dns_server_t *lay
+ spfhook = SPF_voidp2spfhook( spf_dns_server->hook );
+ #endif
+
+-#if HAVE_DECL_RES_NINIT
+ #if 0
++#if HAVE_DECL_RES_NINIT
+ if ( res_ninit( &spfhook->res_state ) != 0 ) {
+ free(spfhook);
+ free(spf_dns_server);
+ return NULL;
+ }
+-#endif
+ #else
+ if ( res_init() != 0 ) {
+ free( spf_dns_server );
+ return NULL;
+ }
++#endif
+ #endif
+
+ return spf_dns_server;