This is a discussion on Re: NAPTR regex escape issues within the Bind Users forums, part of the DNS and Related Forums category; > Hello, > > I am having trouble getting BIND to return regular expressions with > escaped (meta) characters properly. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
> Hello, > > I am having trouble getting BIND to return regular expressions with > escaped (meta) characters properly. I have an amount of NAPTR records > which contain escaped backslashes (\\) and escaped metachars (i.e. \+). > > My problem lies in the fact that double backslashes in a zone file are > returned as such - double backslashes. Single backslashes in the file > are either dropped (i.e. in front of a +) or cause errors when in front > of digits (for regex backreferences such as \1). > > For instance i have the following records in my enum.test zone file: > > 8.7.6.5.4.3.2.1.2.3 IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:\\1@shire.me! > " > 8.7.6.5.4.3.2.1.2.3 IN NAPTR 100 20 "U" "E2U+sip" "!^\\+(32)(12\\d\\d)(56\ > \d\\d)$!sip:\\1@\\2-\\3!" . > > When queried this returns: > > # host -t NAPTR 8.7.6.5.4.3.2.1.2.3.enum.test > 8.7.6.5.4.3.2.1.2.3.enum.test NAPTR 100 20 "U" "E2U+sip" "!^.*$!sip:\\1@shi > re.me!" . > --> \\1 instead of \1 ? > 8.7.6.5.4.3.2.1.2.3.enum.test NAPTR 100 50 "U" "E2U+sip" "!^\\+(32)(12\\d\\ > d)(56\\d\\d)$!sip:\\1@\\2-\\3!" . > --> \\+ instead of \+ ? \\d instead of \d ? > > What is the intended behaviour for regular expression escape sequences > in NAPTR records in zone files? Should clients be built to handle the > double backslashes that are returned? Preferably BIND would immedeately > be able to return the correct regex. NAPTR records are expected be processed in their wire format not their presentation format (inherited from TXT). A backslash on the wire is \\. A double quote is \". A NUL is \000. A carriage return is \013. Dig and host put the record out such that it can be read back in and produce the original wire format. > Thanks, > > Ben > > -- > Ben Turner (Consultant) > SIEMENS - IC MN D SU > tel: +32 14 252326 > > -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews@isc.org |
![]() |
| Thread Tools | |
| Display Modes | |
|
|