[Pdns-users] Exception: unknown escape sequence on NAPTR regex

Peter Fern pdns at obfusc8.org
Mon Aug 11 15:27:39 UTC 2008


Peter Fern wrote:
> Hi Bert,
>
> bert hubert wrote:
>> Can you try doubling the \, so:
>>
>> 100 0 "u" "E2U+sip" "!^\\+([0-9][0-9][0-9])$!sip:\\1 at somesiphost.com!" .
>>   
> As I thought - the slashes are returned verbatim when doubled, and 
> cause the parser to barf when there is only one:
>

OK, this is killing me.  So far I've tracked through to:

pdns/dnswriter.cc:void DNSPacketWriter::xfrText(const string& text, bool)

At which point, the escaped list tokenizer seems to be doing it's job, 
and unescaping the '\\':

Aug 12 00:53:25 ipbx pdns-master[11691]: text: "!^\\+112$!test:SIP/\\1!"
Aug 12 00:53:25 ipbx pdns-master[11691]: *beg: !^\+112$!test:SIP/\1!

It's this section of code that generates the 'unknown escape sequence' 
exception when there's only a single quote, but that's OK - the RFC says 
we must use double-backslash in the zone to generate a single-backslash 
in the record anyway (though a nicer error earlier might be an idea?).  
So, I need to work out how the backslash is getting doubled again, and 
why.  Also, due to the way rcpgenerator's xfrText works, it doesn't look 
like it will be possible to use escaped quotes in the content?

Bert, I'm reaching out for a bit of a hand here... pushing 1:30am, my 
brain is a little fried...

Cheers,
Pete


More information about the Pdns-users mailing list