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

Regex access problem in slapd.conf



slackware 8.0
openldap 2.1.10

Here is the access line that I have in my slapd.conf file:

access to * by dn="uid=(.*),ou=Users,o=ORG,c=US"
group="cn=$1,ou=Users,o=ORG,c=US" write by
dn="uid=Manager,ou=Users,o=ORG,c=US" write by anonymous auth

The problem that I am having is that the $1 variable is not being
populated.  As I understand regular expressions, the (.*) should match on
any pattern.

Here is a chunk of the debug at level 7:

=> regex_matches: string:        uid=memphis@org,ou=users,o=org,c=us
=> regex_matches: rc: 1 no matches
=> string_expand: pattern:  uid=(.*),ou=Users,o=ORG,c=US
=> string_expand: expanded: uid=(.*),ou=Users,o=ORG,c=US
=> regex_matches: string:        uid=memphis@org,ou=users,o=org,c=us
=> regex_matches: rc: 0 matches
=> string_expand: pattern:  cn=$1,ou=Users,o=ORG,c=US
=> string_expand: expanded: cn=,ou=Users,o=ORG,c=US
>>> dnNormalize: <cn=,ou=Users,o=org,c=US>

In this case, trying to login as the user memphis@org, I would expect to
see the $1 variable contain the username, but as you can see, it just
makes it empty.  Just in case, I tried checking the $0 and $2 variables,
but they weren't being populated either.

I've gotten regex to work in some other cases, but this one is just
befuddling me.  Any help would be appreciated.

Paul Wilson