https://bugs.openldap.org/show_bug.cgi?id=10090
Issue ID: 10090 Summary: regex that contains a quoted literal space or escaped space results in a parse error Product: OpenLDAP Version: 2.6.6 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: gburd@symas.com Target Milestone: ---
Searching ACLs using regex expressions should allow for white space.
olcAccess: to dn.subtree="dc=example,dc=com" by dn.regex="ou=Before\ After,o=example[.]com,c=US$" read by * break
or
olcAccess: to dn.subtree="dc=example,dc=com" by dn.regex="ou=Before[ ]After,o=example[.]com,c=US$" read by * break
or any regex that contains a literal space results in a parse error.
It seems like the string is broken on literal spaces irrespective of quoting.
Debug output from slapd:
64cd845c.253aa590 0x7fe6f4fc9640 slapd: line 0: regular expression "ou=Before" bad because of Trailing backslash
This should also include other methods for expressing white space such as `:space:` or `\w` pattern matches.
olcAccess: to dn.subtree="dc=example,dc=com" by dn.regex="ou=Before[[:space:]]After,o=example[.]com,c=US$" read by * break
https://bugs.openldap.org/show_bug.cgi?id=10090
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- On Mon, Aug 07, 2023 at 02:43:33PM +0000, openldap-its@openldap.org wrote:
Searching ACLs using regex expressions should allow for white space.
olcAccess: to dn.subtree="dc=example,dc=com" by dn.regex="ou=Before\ After,o=example[.]com,c=US$" read by * break
or
olcAccess: to dn.subtree="dc=example,dc=com" by dn.regex="ou=Before[ ]After,o=example[.]com,c=US$" read by * break
or any regex that contains a literal space results in a parse error.
It seems like the string is broken on literal spaces irrespective of quoting.
Debug output from slapd:
64cd845c.253aa590 0x7fe6f4fc9640 slapd: line 0: regular expression "ou=Before" bad because of Trailing backslash
This should also include other methods for expressing white space such as `:space:` or `\w` pattern matches.
olcAccess: to dn.subtree="dc=example,dc=com" by dn.regex="ou=Before[[:space:]]After,o=example[.]com,c=US$" read by * break
Can you provide a full example? I've tried to reproduce using the above and everything works just fine. And test006-acl also does the same and there haven't been any issues with that.
Thanks,
https://bugs.openldap.org/show_bug.cgi?id=10090
--- Comment #2 from Howard Chu hyc@openldap.org --- LDIF has its own rules about whitespace and continuation lines. Read the LDIF manpage. Backslash has no meaning there.
https://bugs.openldap.org/show_bug.cgi?id=10090
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs_review | Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
https://bugs.openldap.org/show_bug.cgi?id=10090
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED
https://bugs.openldap.org/show_bug.cgi?id=10090
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID