mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-19 08:13:21 +00:00
- 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]
This commit is contained in:
parent
1f5520d34b
commit
12035fe772
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=179622
@ -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}
|
||||
|
13
mail/libspf2/files/patch-src__libspf2__spf_interpret.c
Normal file
13
mail/libspf2/files/patch-src__libspf2__spf_interpret.c
Normal file
@ -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;
|
@ -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()");
|
||||
}
|
||||
+#else
|
||||
+ if (res_init() != 0) {
|
||||
+ SPF_error("Failed to call res_init()");
|
||||
+ }
|
||||
+#endif
|
||||
pthread_setspecific(res_state_key, (void *)res_state);
|
||||
}
|
||||
@@ -152,6 +165,11 @@ SPF_dns_resolv_lookup(SPF_dns_server_t *
|
||||
else {
|
||||
res_state = (struct __res_state *)res_spec;
|
||||
}
|
||||
+#else
|
||||
+ if ((_res.options & RES_INIT) == 0 && res_init() != 0) {
|
||||
+ SPF_error("Failed to call res_init()");
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
Loading…
Reference in New Issue
Block a user