semi-colon ";" in rdata for TXT records

Jack Tavares j.tavares at F5.com
Tue Oct 2 11:48:32 UTC 2007


>> 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



More information about the bind-users mailing list