ldapsearch -y option does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openldap (Ubuntu) |
Invalid
|
Low
|
Unassigned |
Bug Description
sudo ldapsearch -y /etc/ldap.secrets -D <mybinddn> -b <search base> -xH "ldap://localhost"
does not work, as I get this error:
ldap_bind: Invalid credentials (49)
yet, if I run:
sudo ldapsearch -w $(sudo cat /etc/ldap.secrets) -D <mybinddn> -b <search base> -xH "ldap://localhost"
it works. So that rules out the possibility that /etc/ldap.secrets has a wrong password.
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: ldap-utils 2.4.21-0ubuntu5
ProcVersionSign
Uname: Linux 2.6.32-22-generic i686
Architecture: i386
Date: Wed May 19 15:17:42 2010
ProcEnviron:
LANGUAGE=en_US:en
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: openldap
Thank you for reporting this bug and making Ubuntu better. Did you create the /etc/ldap.secrets file using a text editor such as Vim or nano? If so the editor probably added a CR or LF to the end of the line. If there is such characters the ldap utilities won't recognize the string as a legit password.
Can you try creating /etc/ldap.secrets using:
sudo sh -c "echo -n 'secret' > /etc/ldap.secrets"
Replacing 'secret' with your correct password. Then retry your ldapsearch commands. Using echo with the -n will not add new line characters.