lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mar 28, 2013, at 12:36 AM, William Ahern <william@25thandClement.com> wrote:

>> [3]	It handles 32 DNS record types---about 26 more types than other DNS
>> 	resolving libraries.
> 
> I can't find any code which handles NAPTR pattern matching in SPCDNS. Do you
> just use the POSIX regex library in your applications? (Presuming you
> actually use NAPTR records.) I was always afraid to execute regular
> expressions from untrusted third-parties, _especially_ with builtin POSIX
> regex engines, which are mostly pretty horrible.

It looks like it returns the regex pattern as a string, so presumably the calling app has to decide how to handle it.  That makes sense for telephony applications - since NAPTR is used in ENUM (RFC 3761) resolution, as well as calling name based on a popular draft, among other more proprietary uses.  Regardless, the "original" string to apply the regex to, and replace its matched portion, is only truly known by the upper-layer calling application. (ie, it's not the DNS query key)  And of course letting the calling application do it means it can make some decisions about whether to only handle regex patterns it knows about in-advance (which some telephony vendors do), or optimize for common ones, or truly compile it on the fly, or whatever.

-hadriel