RE: semi-colon ";" in rdata for TXT records - DNS

This is a discussion on RE: semi-colon ";" in rdata for TXT records - DNS ; >> Given these 2 TXT records in a zone file >> isescaped TXT "escaped semi-colon\;" >> unescaped TXT "unescaped semi-colon;" >> (one has an escaped semi-colon, one has an UNescaped semi-colon) >> >> dig returns >> >> isescaped.test.net. 500 IN ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: RE: semi-colon ";" in rdata for TXT records

  1. RE: semi-colon ";" in rdata for TXT records


    >> Given these 2 TXT records in a zone file
    >> isescaped TXT "escaped semi-colon\;"
    >> unescaped TXT "unescaped semi-colon;"
    >> (one has an escaped semi-colon, one has an UNescaped semi-colon)
    >>
    >> dig returns
    >>
    >> isescaped.test.net. 500 IN TXT "escaped

    semi-colon\;"
    >> unescaped.test.net. 500 IN TXT "unescaped

    semi-colon\;"
    >>
    >> dig makes sure that the semi-colon is escaped for output purposes.
    >>
    >> Now I have another tool, written in C/C++ that calls ns_sprintrr

    (from
    > libbind.a)
    >> This does NOT include the "\" before the semi-colon on EITHER TXT

    record

    >> 2. what routine is dig using to print the record?


    >Can't you read the source?


    Of course. Here is the call tree

    printmessage() which calls
    dns_message_sectiontotext() which calls
    dns_master_rdatasettotext() which calls
    rdataset_totext() which calls
    dns_rdata_tofmttext() which calls
    rdata_totext() which calls [via a 100 line switch statement
    declared in a macro in an include file]
    totext_txt() which calls
    txt_totext()
    which always prepends a "\" to a ";"

    Can't imagine how I missed it the first time I looked.

    It is unfortunate, in my opinion, that ns_sprintrr() does not follow the
    same
    logic that dig uses (or vice-versa).

    Would it be unreasonable to request a change to ns_sprintrr() to prepend
    the "\" ?

    Thank you



  2. Re: semi-colon ";" in rdata for TXT records

    In article ,
    "Jack Tavares" wrote:

    > Would it be unreasonable to request a change to ns_sprintrr() to prepend
    > the "\" ?


    Why? As you noticed, the string is interpreted the same way with or
    without the "\", so it's not needed.

    A more serious problem would be if it fails to prepend "\" before
    backslash or doublequote.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***



+ Reply to Thread