Subject: | loginrule in example cause undue angst |
Show quoted text
> ldapserver:dc=Acme, dc=com:cn=*,<ROOT>
I think MOST people (like me) are going to think the "default" example uses the DN for login and try to get Net:LDAP working with DN.
However, it, honestly, took me several hours trying to figure out why I was getting this "invalid password" AD error.
49:80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580
After googling and trial & error, I started on a code review and figured out that the example on CPAN is a custom example for a particular implementation (I don't know anyone who uses the root for user objects). My recommendation is to add another example that uses DN as authentication.
Or better yet, update the code so if the login looks like a DN pass it through instead of using the login rule.
unless ($dbuser =~ m/\ACN=/i) { #dbuser looks like a DN
if ($dbuser && $ldap_loginrule =~ /\*/o)
{
$ldap_loginrule =~ s/\<root\>/$ldap_root/gi;
$_ = $dbuser;
$dbuser = $ldap_loginrule;
$dbuser =~ s/\*/$_/g;
}
}
My Version
$ rpm -q perl-DBD-LDAP
perl-DBD-LDAP-0.20-1.el6.rf.noarch