]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3953. [bug] Don't escape semi-colon in TXT fields. [RT #37159]
authorMark Andrews <marka@isc.org>
Sat, 27 Sep 2014 02:14:20 +0000 (12:14 +1000)
committerMark Andrews <marka@isc.org>
Sat, 27 Sep 2014 02:15:02 +0000 (12:15 +1000)
(cherry picked from commit 9a36fb86f5019f25705d25ea729d03fcf8ecaa95)

CHANGES
bin/tests/system/genzone.sh
bin/tests/system/xfer/dig1.good
bin/tests/system/xfer/dig2.good
lib/dns/rdata.c

diff --git a/CHANGES b/CHANGES
index 6b8a306c30521e93183ebfdb52ee7167d20b6f86..8731ba8f1da0c43cb011605540d01d7030527c8f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3953.  [bug]           Don't escape semi-colon in TXT fields. [RT #37159]
+
 3952.  [bug]           dns_name_fullcompare failed to set *nlabelsp when the
                        two name pointers were the same. [RT #37176]
 
index 9bd4e30eed2e52f3008d3e39ee757e9ccc28a8f3..0d73d1cfdc95e7fef6d15d47cb43f31892ac57ec 100644 (file)
@@ -119,6 +119,9 @@ txt09                       TXT     foo\010bar
 txt10                  TXT     foo\ bar
 txt11                  TXT     "\"foo\""
 txt12                  TXT     \"foo\"
+txt13                  TXT     "foo;"
+txt14                  TXT     "foo\;"
+txt15                  TXT     "bar\\;"
 
 ; type 17
 rp01                   RP      mbox-dname txt-dname
index 15842ab4d6d1bdfbd039b5670941c988b561c24e..7ad4b68158cd64512c24aea4a1bbc524f955227e 100644 (file)
@@ -90,6 +90,9 @@ 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;"
+txt14.example.         3600    IN      TXT     "foo;"
+txt15.example.         3600    IN      TXT     "bar\\;"
 uri01.example.         3600    IN      URI     10 20 "https://www.isc.org/"
 uri02.example.         3600    IN      URI     30 40 "https://www.isc.org/HolyCowThisSureIsAVeryLongURIRecordIDontEvenKnowWhatSomeoneWouldEverWantWithSuchAThingButTheSpecificationRequiresThatWesupportItSoHereWeGoTestingItLaLaLaLaLaLaLaSeriouslyThoughWhyWouldYouEvenConsiderUsingAURIThisLongItSeemsLikeASillyIdeaButEnhWhatAreYouGonnaDo/"
 uri03.example.         3600    IN      URI     30 40 ""
index 2586c9acdcdaa2a9b91d9563c100d490452078bf..cdb95dc4e26c50130348d09f70058259bada42d1 100644 (file)
@@ -90,6 +90,9 @@ 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;"
+txt14.example.         3600    IN      TXT     "foo;"
+txt15.example.         3600    IN      TXT     "bar\\;"
 uri01.example.         3600    IN      URI     10 20 "https://www.isc.org/"
 uri02.example.         3600    IN      URI     30 40 "https://www.isc.org/HolyCowThisSureIsAVeryLongURIRecordIDontEvenKnowWhatSomeoneWouldEverWantWithSuchAThingButTheSpecificationRequiresThatWesupportItSoHereWeGoTestingItLaLaLaLaLaLaLaSeriouslyThoughWhyWouldYouEvenConsiderUsingAURIThisLongItSeemsLikeASillyIdeaButEnhWhatAreYouGonnaDo/"
 uri03.example.         3600    IN      URI     30 40 ""
index 5f2b6713ab32203408bb442205082c5dfcb12206..57531d38070c58540a43697ce233f7e697fd1307 100644 (file)
@@ -1160,12 +1160,12 @@ txt_totext(isc_region_t *source, isc_boolean_t quote, isc_buffer_t *target) {
                        continue;
                }
                /*
-                * Escape double quote, semi-colon, backslash.
-                * If we are not enclosing the string in double
-                * quotes also escape at sign.
+                * Escape double quote and backslash.  If we are not
+                * enclosing the string in double quotes also escape
+                * at sign and semicolon.
                 */
-               if (*sp == 0x22 || *sp == 0x3b || *sp == 0x5c ||
-                   (!quote && *sp == 0x40)) {
+               if (*sp == 0x22 || *sp == 0x5c ||
+                   (!quote && (*sp == 0x40 || *sp == 0x3b))) {
                        if (tl < 2)
                                return (ISC_R_NOSPACE);
                        *tp++ = '\\';