]> granicus.if.org Git - pdns/commitdiff
strip all types of whitespace from around content while parsing zones, fixes #3568
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 14 Mar 2016 15:01:24 +0000 (16:01 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 15 Mar 2016 08:53:04 +0000 (09:53 +0100)
pdns/zoneparser-tng.cc
regression-tests.nobackend/tinydns-data-check/expected_result
regression-tests/zones/example.com

index 3ac6081f63b4e97a77e765f23591daf5309e377c..7f7aa872c5ea23280c4e89d3dd2b41b9ac922a55 100644 (file)
@@ -401,6 +401,7 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment)
       }
     }
   }
+  trim_if(rr.content, is_any_of(" \r\n\x1a"));
 
   vector<string> recparts;
   switch(rr.qtype.getCode()) {
index fdacbfa039c91539e682d9e79446df6ba70b7e71..05c83a9e96b5449556673871f2d4302ecbc5d86f 100644 (file)
@@ -1,4 +1,4 @@
-59a3777d58479963df0a39c8c27061dc  ../regression-tests/zones/example.com
+ac480efeccfd43a434fee71375ca88bc  ../regression-tests/zones/example.com
 b4feb02bd50f7b78cd5c40c7a560019c  ../regression-tests/zones/test.com
 005b3381db2a7dc70b690484f6ab7770  ../regression-tests/zones/test.dyndns
 0861783f9f83acd9044278cda2528ee2  ../regression-tests/zones/wtest.com
index 25f05f6671575f4f17789eb64d33bfab71a4a006..4d0126a64fecc4fd5f28e2bd36b874f4a7e3ce61 100644 (file)
@@ -86,7 +86,9 @@ smtp1                 IN      CNAME   outpost
 ;
 external-mail          IN      MX      25      server1.test.com.
 ;
-text                   IN      TXT     "Hi, this is some text"
+text                   IN      TXT     (  
+ "Hi, this is some text"   
+ )
 multitext                      IN      TXT     "text part one" "text part two" "text part three"
 escapedtext                    IN      TXT     "begin" "the \"middle\" p\\art" "the end"
 text0                  IN      TXT     "k=rsa; p=one"