[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: commit: ldap/servers/slapd filterentry.c



Kurt D. Zeilenga writes:
>Hallvard B Furuseth wrote:
>>kurt@OpenLDAP.org writes:
>>> Rename filter entry's  strcpy_special() to strcpy_regex() to better
>>> reflect its purpose.  Modify switch to support REG_EXTENDED expressions.
>>> Use REG_EXTENDED instead of REG_BASIC everywhere.
>> 
>> Why?
> 
> Because REG_EXTENDED appeared to be more consistently implemented
> than REG_BASIC.

Well, I haven't seen any trouble with REG_BASIC on the OpenLDAP list.
The bug was because OpenLDAP switched from non-POSIX re_comp/re_exec to
POSIX regcomp/regexec without changing the strcpy_special() accordingly.

>> probably faster to use basic regexps
> 
> Likely not.  They both have the same engine underneath and
> provide similiar functionality (especially in view of some
> implementations extensions).

Good point.

> Of course, if we were concerned
> about speed, we might set REG_NOSUB in filterentry use.

Well, why not:-)

>> (Apparently ']' is not a
>> special character in POSIX regexps, it's just something with '['
>> recognizes.  And the behaviour is undefined if an ordinary characer
>> is quoted.)
> 
> In my reading of GNU and HS implementations, \c matches c when c
> is an ordinary character.

Looks like a GNU extension.  I haven't got the POSIX spec, but the
Solaris regex manpage says
     The interpretation of an ordinary character preceded by a backslash
     (\) is undefined.

> So if ] is ordinary, escaping it won't
> hurt.  If ] is an operator (as I believe it is in the GNU regex
> implementation), it needs to be escaped.  Likewise with }.

If so, we need a configure test to check if "]" and "}" are operators.
(Or with basic REs, just "]".)

>>but another is the newer GNU "rx":
>>         #include <rxposix.h>
>>         cc ... -lrx
> 
> Last time I toyed with GNU "rx", IIRC, it installed as <regex.h>/-lrx
> (under the specified --prefix).

They must have changed, then.  I just installed it with no configure
options except --prefix, and got <rxposix.h> and -lrx.
With that kind of variation, I guess it'll have to be in INSTALL and
stay out of configure, which is probably just as well:-)

> I don't know of any OS vendor who
> provides an rx installation (as part of their distribution).

Me neither.  This would be for people who fetch rx because they need a
POSIX regexp package.

-- 
Hallvard