View | Details | Raw Unified | Return to bug 227175 | Differences between
and this patch

Collapse All | Expand All

(-)dns/dnsdist/Makefile (-2 / +27 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	dnsdist
4
PORTNAME=	dnsdist
5
DISTVERSION=	1.3.0
5
DISTVERSION=	1.3.0
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	dns net
7
CATEGORIES=	dns net
8
MASTER_SITES=	https://downloads.powerdns.com/releases/ \
8
MASTER_SITES=	https://downloads.powerdns.com/releases/ \
9
		LOCAL/cpm
9
		LOCAL/cpm
Lines 22-30 Link Here
22
		libsodium.so:security/libsodium
22
		libsodium.so:security/libsodium
23
23
24
GNU_CONFIGURE=	yes
24
GNU_CONFIGURE=	yes
25
USES=		bison compiler cpe gmake libedit libtool localbase lua:52 \
25
USES=		bison compiler cpe gmake libedit libtool localbase \
26
		pkgconfig tar:bz2
26
		pkgconfig tar:bz2
27
CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin \
27
CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin \
28
		--enable-dns-over-tls \
28
		--enable-dnscrypt \
29
		--enable-dnscrypt \
29
		--enable-libsodium \
30
		--enable-libsodium \
30
		--enable-re2
31
		--enable-re2
Lines 36-41 Link Here
36
37
37
USE_RC_SUBR=	dnsdist
38
USE_RC_SUBR=	dnsdist
38
39
40
OPTIONS_DEFINE=		FSTRM LUAJIT SNMP
41
OPTIONS_DEFAULT=	GNUTLS OPENSSL
42
OPTIONS_MULTI=		TLS
43
OPTIONS_MULTI_TLS=	GNUTLS OPENSSL
44
45
FSTRM_DESC=	dnstap support (see dnstap.info)
46
LUAJIT_DESC=	Use LuaJIT instead of Lua
47
48
FSTRM_LIB_DEPENDS=	libfstrm.so:devel/fstrm
49
FSTRM_CONFIGURE_ENABLE=	fstrm
50
51
GNUTLS_LIB_DEPENDS=	libgnutls.so:security/gnutls
52
GNUTLS_CONFIGURE_ENABLE=gnutls
53
54
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so.2:lang/luajit
55
LUAJIT_USES_OFF=	lua
56
LUAJIT_CONFIGURE_WITH=	luajit
57
58
OPENSSL_USES=		ssl
59
OPENSSL_CONFIGURE_ENABLE=libssl
60
61
SNMP_LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
62
SNMP_CONFIGURE_WITH=	net-snmp
63
39
.include <bsd.port.pre.mk>
64
.include <bsd.port.pre.mk>
40
65
41
# Fix dnsdist binaries when building on FreeBSD 10.3
66
# Fix dnsdist binaries when building on FreeBSD 10.3
(-)dns/dnsdist/files/dnsdist.in (-2 / +5 lines)
Lines 22-28 Link Here
22
: ${dnsdist_priv_group:=_dnsdist}
22
: ${dnsdist_priv_group:=_dnsdist}
23
: ${dnsdist_enable:=NO}
23
: ${dnsdist_enable:=NO}
24
24
25
command=/usr/local/sbin/${name}
25
pidfile=/var/run/${name}.pid
26
command_args="-u ${dnsdist_priv_user} -g ${dnsdist_priv_group}"
27
26
27
command=/usr/sbin/daemon
28
actual_command=/usr/local/sbin/${name}
29
command_args="-c -f -r -P ${pidfile} ${actual_command} -u ${dnsdist_priv_user} -g ${dnsdist_priv_group} --supervised"
30
28
run_rc_command "$1"
31
run_rc_command "$1"
(-)dns/dnsdist/files/patch-ext_luawrapper_include_LuaContext.hpp (+28 lines)
Line 0 Link Here
1
--- ext/luawrapper/include/LuaContext.hpp.orig	2018-03-29 15:25:58 UTC
2
+++ ext/luawrapper/include/LuaContext.hpp
3
@@ -2635,11 +2635,21 @@ struct LuaContext::Reader<std::string>
4
     static auto read(lua_State* state, int index)
5
         -> boost::optional<std::string>
6
     {
7
+        std::string result;
8
+
9
+        // lua_tolstring might convert the variable that would confuse lua_next, so we
10
+        //   make a copy of the variable.
11
+        lua_pushvalue(state, index);
12
+
13
         size_t len;
14
-        const auto val = lua_tolstring(state, index, &len);
15
-        if (val == 0)
16
-            return boost::none;
17
-        return std::string(val, len);
18
+        const auto val = lua_tolstring(state, -1, &len);
19
+
20
+        if (val != 0)
21
+          result.assign(val, len);
22
+
23
+        lua_pop(state, 1);
24
+
25
+        return val != 0 ? boost::optional<std::string>{ std::move(result) } : boost::none;
26
     }
27
 };
28
 

Return to bug 227175