]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Do not reject unquoted TXT RR values The masterfile parser incorrectly
authorBob Halley <halley@dnspython.org>
Fri, 2 Sep 2005 05:23:42 +0000 (05:23 +0000)
committerBob Halley <halley@dnspython.org>
Fri, 2 Sep 2005 05:23:42 +0000 (05:23 +0000)
rejected TXT records where a value was not quoted.

Original author: Bob Halley <halley@dnspython.org>
Date: 2004-10-26 00:13:21

ChangeLog
dns/rdtypes/ANY/TXT.py
tests/example
tests/example1.good
tests/example2.good

index db390afd68d874119e9c7d1dcb2dd0d34caa0f52..c6c7d838db273a57d545667b6287a11d4c938fee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-25  Bob Halley  <halley@dnspython.org>
+
+       * dns/rdtypes/ANY/TXT.py (TXT.from_text): The masterfile parser
+       incorrectly rejected TXT records where a value was not quoted.
+
 2004-10-11  Bob Halley  <halley@dnspython.org>
 
        * dns/message.py: Added make_response(), which creates a skeletal
index ec5f1c9e6b4859c15c60a64e596caf3ba80f783b..34267484f2da0c5394530ef8acbfa9c145591052 100644 (file)
@@ -48,8 +48,9 @@ class TXT(dns.rdata.Rdata):
             (ttype, s) = tok.get()
             if ttype == dns.tokenizer.EOL or ttype == dns.tokenizer.EOF:
                 break
-            if ttype != dns.tokenizer.QUOTED_STRING:
-                raise dns.exception.SyntaxError, "expected a quoted string"
+            if ttype != dns.tokenizer.QUOTED_STRING and \
+               ttype != dns.tokenizer.IDENTIFIER:
+                raise dns.exception.SyntaxError, "expected a string"
             if len(s) > 255:
                 raise dns.exception.SyntaxError, "string too long"
             strings.append(s)
index 27420f1ba413fcf263fd44cd7a4070a20f6f07b3..4833201dd3dcd9c3e57288ccb2bced30c7461233 100644 (file)
@@ -170,6 +170,7 @@ txt09                       TXT     "foo\010bar"
 txt10                  TXT     "foo bar"
 txt11                  TXT     "\"foo\""
 txt12                  TXT     "\"foo\""
+txt13                  TXT     foo
 $TTL 300       ; 5 minutes
 u                      TXT     "txt-not-in-nxt"
 $ORIGIN u.example.
index f71c6d452bf63291742939458533a57d42959c79..d80b8ed4e0fda13811e42df59b44ee726ac282b6 100644 (file)
@@ -94,6 +94,7 @@ txt09 3600 IN TXT "foo\010bar"
 txt10 3600 IN TXT "foo bar"
 txt11 3600 IN TXT "\"foo\""
 txt12 3600 IN TXT "\"foo\""
+txt13 3600 IN TXT "foo"
 u 300 IN TXT "txt-not-in-nxt"
 a.u 300 IN A 73.80.65.49
 b.u 300 IN A 73.80.65.49
index 64b6df5c01ac8dd658e1802b3efeaff24d80d706..62d6ace1cea1777a1ed9836f31fb6725d83b0be2 100644 (file)
@@ -94,6 +94,7 @@ txt09.example. 3600 IN TXT "foo\010bar"
 txt10.example. 3600 IN TXT "foo bar"
 txt11.example. 3600 IN TXT "\"foo\""
 txt12.example. 3600 IN TXT "\"foo\""
+txt13.example. 3600 IN TXT "foo"
 u.example. 300 IN TXT "txt-not-in-nxt"
 a.u.example. 300 IN A 73.80.65.49
 b.u.example. 300 IN A 73.80.65.49