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

Peter Fern pdns at obfusc8.org
Thu Jul 31 07:00:39 UTC 2008


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:

Here is the result with a single '\':

mysql> select * from records where id = 47;
+----+-----------+----------------+-------+-----------------------------------------------------+------+------+-------------+
| id | domain_id | name           | type  | 
content                                             | ttl  | prio | 
change_date |
+----+-----------+----------------+-------+-----------------------------------------------------+------+------+-------------+
| 47 |         1 | 2.1.1.e164.nts | NAPTR | 100 0 "u" "E2U+target" 
"!^\+112$!target:SIP/\1!" . |   3600 |    0 |  1216282773 |
+----+-----------+----------------+-------+-----------------------------------------------------+------+------+-------------+

# host -t naptr 2.1.1.e164.nts
Host 2.1.1.e164.nts not found: 3(NXDOMAIN)

Jul 31 16:49:03 ipbx pdns-master[841]: Exception: unknown escape sequence


And with a double '\':

mysql> select * from records where id = 47;
+----+-----------+----------------+-------+-----------------------------------------------------+------+------+-------------+
| id | domain_id | name           | type  | 
content                                             | ttl  | prio | 
change_date |
+----+-----------+----------------+-------+-----------------------------------------------------+------+------+-------------+
| 47 |         1 | 2.1.1.e164.nts | NAPTR | 100 0 "u" "E2U+target" 
"!^\\+112$!target:SIP/\\1!" . |   3600 |    0 |  1216282773 |
+----+-----------+----------------+-------+-----------------------------------------------------+------+------+-------------+

# host -t naptr 2.1.1.e164.nts
2.1.1.e164.nts has NAPTR record 100 0 "u" "E2U+target" 
"!^\\+112$!target:SIP/\\1!" .


Regards,
Pete


More information about the Pdns-users mailing list