]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #2495 from gryphius/fix-doc-email
authorPieter Lexis <pieterlexis@users.noreply.github.com>
Thu, 7 May 2015 09:13:20 +0000 (11:13 +0200)
committerPieter Lexis <pieterlexis@users.noreply.github.com>
Thu, 7 May 2015 09:13:20 +0000 (11:13 +0200)
replace broken mailto: markdown links with static html

docs/Makefile.am
docs/markdown/appendix/compiling-powerdns.md
m4/pdns_with_lua.m4
pdns/arguments.cc
pdns/dnsname.cc
pdns/dnsname.hh
pdns/misc.hh
pdns/randomhelper.cc
pdns/test-dnsname_cc.cc

index 6aa8c182783737da544b86116d80ba852110518f..ad9e6983c6a58f93cffc03dc1c897d5f10b37055 100644 (file)
@@ -37,7 +37,7 @@ endif
 EXTRA_DIST = manpages \
        markdown
 
-.PHONY: html manpages
+.PHONY: html all-manpages
 html: html/index.html
 
 html/index.html: process-md.sh mkdocs.yml markdown/** markdown/*/** manpages/*
@@ -51,7 +51,7 @@ html/index.html: process-md.sh mkdocs.yml markdown/** markdown/*/** manpages/*
 html.tar.bz2: html
        tar cjf html.tar.bz2 html/
 
-manpages: $(MANPAGES_TARGET_ALL)
+all-manpages: $(MANPAGES_TARGET_ALL)
 
 if HAVE_PANDOC
 $(MANPAGES_TARGET_ALL): %: manpages/%.md
index 2987eb5028a784df6f3ae29b4def72fb91334c90..9ec622e8fd06052ac55c99979fb91a565b037b9d 100644 (file)
@@ -52,8 +52,7 @@ tested on OS X.
 The recursor has been reported to crash for some OS X users.
 
 ### OpenBSD
-Compiles but then does not work very well. We hear that it may work with more
-recent versions of gcc, please let us know on `<pdns-dev@mailman.powerdns.com>`.
+Compiles, but use gmake.
 
 ### Solaris
 Solaris 8 and 9 work fine. The 'Sunpro' compiler has not been tried but is
index f87944bee4cb390f0971f073866e8c6ed640c733..1956a1538dac00ca1fb69f29473eb4dcd6441f52 100644 (file)
@@ -9,7 +9,7 @@ AC_DEFUN([PDNS_WITH_LUA],[
 
   AS_IF([test "x$with_lua" != "xno"],[
     AS_IF([test "x$with_lua" = "xyes" -o "x$with_lua" = "xauto"],
-      [for LUAPC in lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua; do
+      [for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do
          PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
            AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua])
            with_lua=yes
index 0137a6d6b7b5501009c5026ccbc7f1770d4ff1a4..82bf9dfb8488e1cd960f9849216c02d0f7e5c51f 100644 (file)
@@ -393,7 +393,7 @@ bool ArgvMap::parseFile(const char *fname, const string& arg, bool lax) {
   while(getline(f,pline)) {
     trim_right(pline);
     
-    if(pline[pline.size()-1]=='\\') {
+    if(!pline.empty() && pline[pline.size()-1]=='\\') {
       line+=pline.substr(0,pline.length()-1);
       continue;
     }
index 8f1bb5b0f52b62dc3176dd95d7b0417f1a1ed90f..a3d2778e9d2f97d04e99deea5dc4df816de86213 100644 (file)
@@ -20,6 +20,7 @@ DNSName::DNSName(const char* p)
 
 DNSName::DNSName(const char* pos, int len, int offset, bool uncompress, uint16_t* qtype, uint16_t* qclass, unsigned int* consumed)
 {
+  d_recurse = 0;
   packetParser(pos, len, offset, uncompress, qtype, qclass, consumed);
 }
 
@@ -38,9 +39,11 @@ void DNSName::packetParser(const char* pos, int len, int offset, bool uncompress
       labellen &= (~0xc0);
       int newpos = (labellen << 8) + *(const unsigned char*)pos;
 
-      if(newpos < offset)
+      if(newpos < offset) {
+        if (++d_recurse > 100)
+          throw std::range_error("Abort label decompression after 100 redirects");
         packetParser(opos, len, newpos, true);
-      else
+      else
         throw std::range_error("Found a forward reference during label decompression");
       pos++;
       break;
index f2b83a6d67beb75b4d6102d7490fd06d1fbf7fb5..de5623502c5935fd2794db0d2bd0ee60292d6815 100644 (file)
@@ -60,6 +60,7 @@ private:
   //  typedef __gnu_cxx::__sso_string string_t;
   typedef std::string string_t;
   string_t d_storage;
+  int d_recurse;
 
   void packetParser(const char* p, int len, int offset, bool uncompress, uint16_t* qtype=0, uint16_t* qclass=0, unsigned int* consumed=0);
   static std::string escapeLabel(const std::string& orig);
index 03d4f7c09c4183ddef7c25c0288cac2f7d8ccbf1..99632853d53cd256e8c9f7922373bfbabab694b2 100644 (file)
@@ -21,6 +21,7 @@
 */
 #ifndef MISC_HH
 #define MISC_HH
+#include <errno.h>
 #include <inttypes.h>
 #include <cstring>
 #include <cstdio>
index 9ea1b22c1f38696bb15e4c2d8a0c3ecb8e35ee2b..8d8b2db57b8d1ea8d980cd38e4d8567861f687cc 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include "dns_random.hh"                     
 
 void seedRandom(const string& source)
index 547ab32385b8fa33d640841758a7a68fac552f17..a457a9e12f7d85d6de6cc8a609edc914ca5d36d1 100644 (file)
@@ -410,5 +410,21 @@ BOOST_AUTO_TEST_CASE(test_compression_loop1) { // Compression loop (pointer loop
   BOOST_CHECK_THROW(DNSName dn(name.c_str(), name.size(), 0, true), std::range_error);
 }
 
+BOOST_AUTO_TEST_CASE(test_compression_loop2) { // Compression loop (deep recursion)
+
+  int i;
+  string name("\x00\xc0\x00", 3);
+  for (i=0; i<98; ++i) {
+    name.append( 1, ((i >> 7) & 0xff) | 0xc0);
+    name.append( 1, ((i << 1) & 0xff) | 0x01);
+  }
+  BOOST_CHECK_NO_THROW(DNSName dn(name.c_str(), name.size(), name.size()-2, true));
+
+  ++i;
+  name.append( 1, ((i >> 7) & 0xff) | 0xc0);
+  name.append( 1, ((i << 1) & 0xff) | 0x01);
+
+  BOOST_CHECK_THROW(DNSName dn(name.c_str(), name.size(), name.size()-2, true), std::range_error);
+}
 
 BOOST_AUTO_TEST_SUITE_END()