View | Details | Raw Unified | Return to bug 216135
Collapse All | Expand All

(-)dns/powerdns-recursor/Makefile (-2 / +1 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	recursor
4
PORTNAME=	recursor
5
PORTVERSION=	4.0.3
5
PORTVERSION=	4.0.4
6
PORTREVISION=	3
7
CATEGORIES=	dns ipv6
6
CATEGORIES=	dns ipv6
8
MASTER_SITES=	http://downloads.powerdns.com/releases/
7
MASTER_SITES=	http://downloads.powerdns.com/releases/
9
PKGNAMEPREFIX=	powerdns-
8
PKGNAMEPREFIX=	powerdns-
(-)dns/powerdns-recursor/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1473284590
1
TIMESTAMP = 1484621032
2
SHA256 (pdns-recursor-4.0.3.tar.bz2) = ae9813a64d13d9ebe4b44e89e8e4e44fc438693b6ce4c3a98e4cab1af22d9627
2
SHA256 (pdns-recursor-4.0.4.tar.bz2) = 2338778f49ccd03401e65f6f4b39047890e691c8ff6d810ecee45321fb4f1e4d
3
SIZE (pdns-recursor-4.0.3.tar.bz2) = 1045041
3
SIZE (pdns-recursor-4.0.4.tar.bz2) = 1050596
(-)dns/powerdns-recursor/files/extrapatch-setuid (-6 / +6 lines)
Lines 1-8 Link Here
1
--- pdns_recursor.cc.orig	2010-03-06 13:10:44.000000000 +0100
1
--- pdns_recursor.cc.orig	2017-01-17 02:48:30 UTC
2
+++ pdns_recursor.cc	2010-03-07 21:13:07.000000000 +0100
2
+++ pdns_recursor.cc
3
@@ -1890,8 +1890,8 @@
3
@@ -2969,8 +2969,8 @@ int main(int argc, char **argv)
4
     ::arg().set("daemon","Operate as a daemon")="yes";
4
     ::arg().set("disable-syslog","Disable logging to syslog, useful when running inside a supervisor that logs stdout")="no";
5
     ::arg().set("log-common-errors","If we should log rather common errors")="yes";
5
     ::arg().set("log-common-errors","If we should log rather common errors")="no";
6
     ::arg().set("chroot","switch to chroot jail")="";
6
     ::arg().set("chroot","switch to chroot jail")="";
7
-    ::arg().set("setgid","If set, change group id to this gid for more security")="";
7
-    ::arg().set("setgid","If set, change group id to this gid for more security")="";
8
-    ::arg().set("setuid","If set, change user id to this uid for more security")="";
8
-    ::arg().set("setuid","If set, change user id to this uid for more security")="";
Lines 10-13 Link Here
10
+    ::arg().set("setuid","If set, change user id to this uid for more security")="pdns_recursor";
10
+    ::arg().set("setuid","If set, change user id to this uid for more security")="pdns_recursor";
11
     ::arg().set("network-timeout", "Wait this nummer of milliseconds for network i/o")="1500";
11
     ::arg().set("network-timeout", "Wait this nummer of milliseconds for network i/o")="1500";
12
     ::arg().set("threads", "Launch this number of threads")="2";
12
     ::arg().set("threads", "Launch this number of threads")="2";
13
 #ifdef WIN32
13
     ::arg().set("processes", "Launch this number of processes (EXPERIMENTAL, DO NOT CHANGE)")="1"; // if we un-experimental this, need to fix openssl rand seeding for multiple PIDs!
(-)dns/powerdns-recursor/files/patch-dnsname.hh (-7 / +5 lines)
Lines 1-13 Link Here
1
https://github.com/PowerDNS/pdns/issues/2955
1
--- dnsname.hh.orig	2017-01-17 03:18:41 UTC
2
3
--- dnsname.hh.orig	2016-09-06 12:50:29 UTC
4
+++ dnsname.hh
2
+++ dnsname.hh
5
@@ -30,7 +30,7 @@
3
@@ -30,7 +30,7 @@
6
 #include <boost/version.hpp>
4
 #include <boost/version.hpp>
7
 
5
 
8
 // it crashes on OSX and doesn't compile on OpenBSD
6
 // it crashes on OSX and doesn't compile on OpenBSD
9
-#if BOOST_VERSION >= 104800 && ! defined( __APPLE__ ) && ! defined(__OpenBSD__)
7
-#if BOOST_VERSION >= 105300 && ! defined( __APPLE__ ) && ! defined(__OpenBSD__)
10
+#if BOOST_VERSION >= 104800 && ! defined(_LIBCPP_VERSION) && ! defined(__OpenBSD__)
8
+#if BOOST_VERSION >= 105300 && ! defined(_LIBCPP_VERSION) && ! defined(__OpenBSD__)
11
 #include <boost/container/string.hpp>
9
 #include <boost/container/string.hpp>
12
 #endif
10
 #endif
13
 
11
 
Lines 15-22 https://github.com/PowerDNS/pdns/issues/2955 Link Here
15
   inline bool canonCompare(const DNSName& rhs) const;
13
   inline bool canonCompare(const DNSName& rhs) const;
16
   bool slowCanonCompare(const DNSName& rhs) const;  
14
   bool slowCanonCompare(const DNSName& rhs) const;  
17
 
15
 
18
-#if BOOST_VERSION >= 104800 && ! defined( __APPLE__ ) && ! defined(__OpenBSD__)
16
-#if BOOST_VERSION >= 105300 && ! defined( __APPLE__ ) && ! defined(__OpenBSD__)
19
+#if BOOST_VERSION >= 104800 && ! defined(_LIBCPP_VERSION) && ! defined(__OpenBSD__)
17
+#if BOOST_VERSION >= 105300 && ! defined(_LIBCPP_VERSION) && ! defined(__OpenBSD__)
20
   typedef boost::container::string string_t;
18
   typedef boost::container::string string_t;
21
 #else
19
 #else
22
   typedef std::string string_t;
20
   typedef std::string string_t;
(-)dns/powerdns-recursor/files/patch-lua-recursor4.cc (-26 lines)
Removed Link Here
1
--- lua-recursor4.cc.orig	2016-09-06 12:50:29 UTC
2
+++ lua-recursor4.cc
3
@@ -263,8 +263,8 @@ RecursorLua4::RecursorLua4(const std::st
4
       return DNSName(boost::get<const DNSName>(dom));
5
   });
6
   d_lw->registerFunction("isPartOf", &DNSName::isPartOf);
7
-  d_lw->registerFunction("countLabels", &DNSName::countLabels);
8
-  d_lw->registerFunction("wirelength", &DNSName::wirelength);
9
+  d_lw->registerFunction<unsigned int(DNSName::*)()>("countLabels", [](const DNSName& name) { return name.countLabels(); });
10
+  d_lw->registerFunction<size_t(DNSName::*)()>("wirelength", [](const DNSName& name) { return name.wirelength(); });
11
   d_lw->registerFunction<bool(DNSName::*)(const std::string&)>(
12
     "equal",
13
      [](const DNSName& lhs, const std::string& rhs) {
14
@@ -285,9 +285,9 @@ RecursorLua4::RecursorLua4(const std::st
15
     } );
16
   d_lw->registerFunction<bool(ComboAddress::*)()>("isIPv4", [](const ComboAddress& ca) { return ca.sin4.sin_family == AF_INET; });
17
   d_lw->registerFunction<bool(ComboAddress::*)()>("isIPv6", [](const ComboAddress& ca) { return ca.sin4.sin_family == AF_INET6; });
18
-  d_lw->registerFunction("isMappedIPv4", &ComboAddress::isMappedIPv4);
19
-  d_lw->registerFunction("mapToIPv4", &ComboAddress::mapToIPv4);
20
-  d_lw->registerFunction("truncate", &ComboAddress::truncate);
21
+  d_lw->registerFunction<bool(ComboAddress::*)()>("isMappedIPv4", [](const ComboAddress& ca) { return ca.isMappedIPv4(); });
22
+  d_lw->registerFunction<ComboAddress(ComboAddress::*)()>("mapToIPv4", [](const ComboAddress& ca) { return ca.mapToIPv4(); });
23
+  d_lw->registerFunction<void(ComboAddress::*)(unsigned int)>("truncate", [](ComboAddress& ca, unsigned int bits) { ca.truncate(bits); });
24
 
25
   d_lw->writeFunction("newCA", [](const std::string& a) { return ComboAddress(a); });
26
   typedef std::unordered_set<ComboAddress,ComboAddress::addressOnlyHash,ComboAddress::addressOnlyEqual> cas_t;
(-)dns/powerdns-recursor/files/patch-mtasker__fcontext.cc (-154 lines)
Removed Link Here
1
rec: Add support for boost::context >= 1.61
2
3
https://github.com/PowerDNS/pdns/commits/64413f6afd9b/pdns/mtasker_fcontext.cc
4
5
--- mtasker_fcontext.cc.orig	2016-09-06 12:50:29 UTC
6
+++ mtasker_fcontext.cc
7
@@ -23,14 +23,15 @@
8
 #include <exception>
9
 #include <cassert>
10
 #include <type_traits>
11
-#if BOOST_VERSION > 106100
12
-#include <boost/context/detail/fcontext.hpp>
13
-#else
14
-#include <boost/context/fcontext.hpp>
15
-#endif
16
 #include <boost/version.hpp>
17
-
18
+#if BOOST_VERSION < 106100
19
+#include <boost/context/fcontext.hpp>
20
 using boost::context::make_fcontext;
21
+#else
22
+#include <boost/context/detail/fcontext.hpp>
23
+using boost::context::detail::make_fcontext;
24
+#endif /* BOOST_VERSION < 106100 */
25
+
26
 
27
 #if BOOST_VERSION < 105600
28
 /* Note: This typedef means functions taking fcontext_t*, like jump_fcontext(),
29
@@ -61,8 +62,15 @@ jump_fcontext (fcontext_t* const ofc, fc
30
     }
31
 }
32
 #else
33
+
34
+#if BOOST_VERSION < 106100
35
 using boost::context::fcontext_t;
36
 using boost::context::jump_fcontext;
37
+#else
38
+using boost::context::detail::fcontext_t;
39
+using boost::context::detail::jump_fcontext;
40
+using boost::context::detail::transfer_t;
41
+#endif /* BOOST_VERSION < 106100 */
42
 
43
 static_assert (std::is_pointer<fcontext_t>::value,
44
                "Boost Context has changed the fcontext_t type again :-(");
45
@@ -72,7 +80,9 @@ static_assert (std::is_pointer<fcontext_
46
  * jump. args_t simply provides a way to pass more by reference.
47
  */
48
 struct args_t {
49
+#if BOOST_VERSION < 106100
50
     fcontext_t prev_ctx = nullptr;
51
+#endif
52
     pdns_ucontext_t* self = nullptr;
53
     boost::function<void(void)>* work = nullptr;
54
 };
55
@@ -80,7 +90,11 @@ struct args_t {
56
 extern "C" {
57
 static
58
 void
59
+#if BOOST_VERSION < 106100
60
 threadWrapper (intptr_t const xargs) {
61
+#else
62
+threadWrapper (transfer_t const t) {
63
+#endif
64
     /* Access the args passed from pdns_makecontext, and copy them directly from
65
      * the calling stack on to ours (we're now using the MThreads stack).
66
      * This saves heap allocating an args object, at the cost of an extra
67
@@ -90,11 +104,28 @@ threadWrapper (intptr_t const xargs) {
68
      * the behaviour of the System V implementation, which can inherently only
69
      * be passed ints and pointers.
70
      */
71
+#if BOOST_VERSION < 106100
72
     auto args = reinterpret_cast<args_t*>(xargs);
73
+#else
74
+    auto args = reinterpret_cast<args_t*>(t.data);
75
+#endif
76
     auto ctx = args->self;
77
     auto work = args->work;
78
+    /* we switch back to pdns_makecontext() */
79
+#if BOOST_VERSION < 106100
80
     jump_fcontext (reinterpret_cast<fcontext_t*>(&ctx->uc_mcontext),
81
                    static_cast<fcontext_t>(args->prev_ctx), 0);
82
+#else
83
+    transfer_t res = jump_fcontext (t.fctx, 0);
84
+    /* we got switched back from pdns_swapcontext() */
85
+    if (res.data) {
86
+      /* if res.data is not a nullptr, it holds a pointer to the context
87
+         we just switched from, and we need to fill it to be able to
88
+         switch back to it later. */
89
+      fcontext_t* ptr = static_cast<fcontext_t*>(res.data);
90
+      *ptr = res.fctx;
91
+    }
92
+#endif
93
     args = nullptr;
94
 
95
     try {
96
@@ -106,9 +137,14 @@ threadWrapper (intptr_t const xargs) {
97
 
98
     /* Emulate the System V uc_link feature. */
99
     auto const next_ctx = ctx->uc_link->uc_mcontext;
100
+#if BOOST_VERSION < 106100
101
     jump_fcontext (reinterpret_cast<fcontext_t*>(&ctx->uc_mcontext),
102
                    static_cast<fcontext_t>(next_ctx),
103
                    static_cast<bool>(ctx->exception));
104
+#else
105
+    jump_fcontext (static_cast<fcontext_t>(next_ctx), 0);
106
+#endif
107
+
108
 #ifdef NDEBUG
109
     __builtin_unreachable();
110
 #endif
111
@@ -129,10 +165,27 @@ pdns_ucontext_t::~pdns_ucontext_t
112
 void
113
 pdns_swapcontext
114
 (pdns_ucontext_t& __restrict octx, pdns_ucontext_t const& __restrict ctx) {
115
+  /* we either switch back to threadwrapper() if it's the first time,
116
+     or we switch back to pdns_swapcontext(),
117
+     in both case we will be returning from a call to jump_fcontext(). */
118
+#if BOOST_VERSION < 106100
119
     if (jump_fcontext (reinterpret_cast<fcontext_t*>(&octx.uc_mcontext),
120
                        static_cast<fcontext_t>(ctx.uc_mcontext), 0)) {
121
         std::rethrow_exception (ctx.exception);
122
     }
123
+#else
124
+  transfer_t res = jump_fcontext (static_cast<fcontext_t>(ctx.uc_mcontext), &octx.uc_mcontext);
125
+  if (res.data) {
126
+    /* if res.data is not a nullptr, it holds a pointer to the context
127
+       we just switched from, and we need to fill it to be able to
128
+       switch back to it later. */
129
+    fcontext_t* ptr = static_cast<fcontext_t*>(res.data);
130
+    *ptr = res.fctx;
131
+  }
132
+  if (ctx.exception) {
133
+    std::rethrow_exception (ctx.exception);
134
+  }
135
+#endif
136
 }
137
 
138
 void
139
@@ -146,7 +199,15 @@ pdns_makecontext
140
     args_t args;
141
     args.self = &ctx;
142
     args.work = &start;
143
+    /* jumping to threadwrapper */
144
+#if BOOST_VERSION < 106100
145
     jump_fcontext (reinterpret_cast<fcontext_t*>(&args.prev_ctx),
146
                    static_cast<fcontext_t>(ctx.uc_mcontext),
147
                    reinterpret_cast<intptr_t>(&args));
148
+#else
149
+    transfer_t res = jump_fcontext (static_cast<fcontext_t>(ctx.uc_mcontext),
150
+                                    &args);
151
+    /* back from threadwrapper, updating the context */
152
+    ctx.uc_mcontext = res.fctx;
153
+#endif
154
 }

Return to bug 216135