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

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

Hallvard B Furuseth wrote:
> The bug was because OpenLDAP switched from non-POSIX re_comp/re_exec to
> POSIX regcomp/regexec without changing the strcpy_special() accordingly.

Yes, as I noted in my ITS response.  However, we should have transitioned
directly to REG_EXTENDED when we made the move to POSIX.  REG_BASIC
syntax is considered obsolete and only implemented to provide backwards compatibility.  As this regex use is internal, we have no excuse not to
use the modern REG_EXTENDED syntax.

> > 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.

But is that undefined behavior to match the ordinary character?
I suspect it behaves like HS's regex (because it's likely is HS regex :-).

> > 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 "]".)

Don't forget ')'...  most BSDs treat "xxx)yyy" as an invalid regex.
However, due to an error in the specification, it's legal.

> > 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.

I only made the change to support testing...  I added no configure
support for it.