summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbsiegert <bsiegert@pkgsrc.org>2017-11-25 09:04:18 +0000
committerbsiegert <bsiegert@pkgsrc.org>2017-11-25 09:04:18 +0000
commit90409a41a58483a3021085b91e70c9aeba377285 (patch)
tree2f88472d6b0221f094f1f106404d7b5df266e5e9
parent3b03c38fc425c84df46a557edbdef2ef90ac494a (diff)
downloadpkgsrc-90409a41a58483a3021085b91e70c9aeba377285.tar.gz
Pullup ticket #5650 - requested by he
sysutils/zabbix: bugfix Revisions pulled up: - sysutils/zabbix/Makefile 1.4+patch - sysutils/zabbix/distinfo 1.4+patch - sysutils/zabbix/patches/patch-src_libs_zbxsysinfo_common_net.c 1.1+patch --- Module Name: pkgsrc Committed By: he Date: Thu Nov 16 11:01:12 UTC 2017 Modified Files: pkgsrc/sysutils/zabbix: Makefile distinfo Added Files: pkgsrc/sysutils/zabbix/patches: patch-src_libs_zbxsysinfo_common_net.c Log Message: Zabbix_agentd is a threaded program, and it tries to muck with the global `_res' variable. That's not supported on NetBSD, and IME causes the zabbix agent daemon to exit shortly after having been started. Convert to instead using res_ninit(), res_nsend(), and res_nclose(). Bump PKGREVISION.
-rw-r--r--sysutils/zabbix/Makefile4
-rw-r--r--sysutils/zabbix/distinfo3
-rw-r--r--sysutils/zabbix/patches/patch-src_libs_zbxsysinfo_common_net.c75
3 files changed, 79 insertions, 3 deletions
diff --git a/sysutils/zabbix/Makefile b/sysutils/zabbix/Makefile
index a6775c1df62..01f6d4412cd 100644
--- a/sysutils/zabbix/Makefile
+++ b/sysutils/zabbix/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2017/09/18 09:53:35 maya Exp $
+# $NetBSD: Makefile,v 1.3.4.1 2017/11/25 09:04:18 bsiegert Exp $
-PKGREVISION= 2
+PKGREVISION= 4
.include "Makefile.common"
COMMENT= Enterprise-class Monitoring Solution for Everyone
diff --git a/sysutils/zabbix/distinfo b/sysutils/zabbix/distinfo
index c6a9b204b2b..25d6149ed8d 100644
--- a/sysutils/zabbix/distinfo
+++ b/sysutils/zabbix/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2017/07/26 08:24:06 adam Exp $
+$NetBSD: distinfo,v 1.3.4.1 2017/11/25 09:04:18 bsiegert Exp $
SHA1 (zabbix-3.2.7.tar.gz) = eb5bd34e1ad3dd75c54ed072f0799d55d0939d49
RMD160 (zabbix-3.2.7.tar.gz) = 7997a7a1419d8d543ba0f8e961a247a04272c438
@@ -6,6 +6,7 @@ SHA512 (zabbix-3.2.7.tar.gz) = f60c82829c076a7f8b9d2f0c7dc91f7b65594ac4dcfaa08b1
Size (zabbix-3.2.7.tar.gz) = 16016367 bytes
SHA1 (patch-frontends_php_locale_add__new__language.sh) = c187e2b4ae8dd9e409f5c32469cb7b0f02647d8b
SHA1 (patch-frontends_php_locale_make__mo.sh) = 2f0aaa63e80fcd5d4fa8c507fd764f80070b7864
+SHA1 (patch-src_libs_zbxsysinfo_common_net.c) = 29d0d81b100eb65ea6e96dde08f930e3b834fb3c
SHA1 (patch-src_zabbix__agent_Makefile.in) = a591c3e831eb34dc10cb5b1078891b5cad53b756
SHA1 (patch-src_zabbix__proxy_Makefile.in) = 535eccd707a8947903fbec41028b127a3bbbeffc
SHA1 (patch-src_zabbix__server_Makefile.in) = d297b8c4a940867d0a3eaff7bcb3b178a87dfd49
diff --git a/sysutils/zabbix/patches/patch-src_libs_zbxsysinfo_common_net.c b/sysutils/zabbix/patches/patch-src_libs_zbxsysinfo_common_net.c
new file mode 100644
index 00000000000..9e2eb382e07
--- /dev/null
+++ b/sysutils/zabbix/patches/patch-src_libs_zbxsysinfo_common_net.c
@@ -0,0 +1,75 @@
+$NetBSD: patch-src_libs_zbxsysinfo_common_net.c,v 1.2.2.2 2017/11/25 09:04:18 bsiegert Exp $
+
+Can't portably use _res in a threaded program(!)
+Convert to using res_nsend().
+
+--- src/libs/zbxsysinfo/common/net.c.orig 2017-07-18 10:41:07.000000000 +0000
++++ src/libs/zbxsysinfo/common/net.c
+@@ -236,6 +236,7 @@ static int dns_query(AGENT_REQUEST *requ
+ struct servent *s;
+ HEADER *hp;
+ struct protoent *pr;
++ struct __res_state res_state;
+ #if PACKETSZ > 1024
+ unsigned char buf[PACKETSZ];
+ #else
+@@ -465,13 +466,14 @@ static int dns_query(AGENT_REQUEST *requ
+ pDnsRecord = pDnsRecord->pNext;
+ }
+ #else /* not _WINDOWS */
+- if (-1 == res_init()) /* initialize always, settings might have changed */
++ memset(&res_state, 0, sizeof(res_state));
++ if (-1 == res_ninit(&res_state)) /* initialize always, settings might have changed */
+ {
+ SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot initialize DNS subsystem: %s", zbx_strerror(errno)));
+ return SYSINFO_RET_FAIL;
+ }
+
+- if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
++ if (-1 == (res = res_nmkquery(&res_state, QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
+ {
+ SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot create DNS query: %s", zbx_strerror(errno)));
+ return SYSINFO_RET_FAIL;
+@@ -488,33 +490,20 @@ static int dns_query(AGENT_REQUEST *requ
+ memcpy(&saved_ns, &(_res.nsaddr_list[0]), sizeof(struct sockaddr_in));
+ saved_nscount = _res.nscount;
+
+- _res.nsaddr_list[0].sin_addr = inaddr;
+- _res.nsaddr_list[0].sin_family = AF_INET;
+- _res.nsaddr_list[0].sin_port = htons(ZBX_DEFAULT_DNS_PORT);
+- _res.nscount = 1;
++ res_state.nsaddr_list[0].sin_addr = inaddr;
++ res_state.nsaddr_list[0].sin_family = AF_INET;
++ res_state.nsaddr_list[0].sin_port = htons(ZBX_DEFAULT_DNS_PORT);
++ res_state.nscount = 1;
+ }
+
+- saved_options = _res.options;
+- saved_retrans = _res.retrans;
+- saved_retry = _res.retry;
+-
+ if (0 != use_tcp)
+- _res.options |= RES_USEVC;
+-
+- _res.retrans = retrans;
+- _res.retry = retry;
+-
+- res = res_send(buf, res, answer.buffer, sizeof(answer.buffer));
++ res_state.options |= RES_USEVC;
+
+- _res.options = saved_options;
+- _res.retrans = saved_retrans;
+- _res.retry = saved_retry;
++ res_state.retrans = retrans;
++ res_state.retry = retry;
+
+- if (NULL != ip && '\0' != *ip)
+- {
+- memcpy(&(_res.nsaddr_list[0]), &saved_ns, sizeof(struct sockaddr_in));
+- _res.nscount = saved_nscount;
+- }
++ res = res_nsend(&res_state, buf, res, answer.buffer, sizeof(answer.buffer));
++ res_ndestroy(&res_state);
+
+ hp = (HEADER *)answer.buffer;
+