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

Re: Double escaping \ in regex in slapo-constraint directives in slapd.conf



On 05/03/13 18:26, Pierangelo Masarati wrote:
Not a slapo-constraint(5) issue, but a slapd.conf(5) issue.  '\' is the
escape char for slapd.conf(5).  If you want a '\' to appear in a string,
you need to escape it.  So

constraint_attribute mail regex ^[^@]+@[a-z0-9\-]+(\\.[a-z0-9\-]+)*$

passes '^[^@]+@[a-z0-9-]+(\.[a-z0-9-]+)*$' to the regex parser.

p.

Thank you Pierangelo - as it says, in hindsight, on line 45 of man slapd.conf.

I apologise for my madness! But as slapo-constraint(5) does have slapd.conf examples, it might be a suggestion to explicitly include an extra one with \ escaping noted :)


Cheers,

Tim


--
Tim Watts
Personal Blog:                          http://squiddy.blog.dionic.net/

http://www.sensorly.com/ Crowd mapping of 2G/3G/4G mobile signal coverage