Full_Name: Baulin Sergey Version: unknown OS: Debian8.3 URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (195.26.169.27)
Hello.
ldapsearch: @(#) $OpenLDAP: ldapsearch (Jan 17 2016 16:01:42) $ buildd@x86-csail-01:/build/openldap-EAKxYy/openldap-2.4.40+dfsg/debian/build/clients/tools (LDAP library: OpenLDAP 20440)
I am running in bash: ldapsearch -H ldap://server -w password -b "DC=domain,DC=local" -s sub -D 'CN=user,DC=domain,DC=local' -x "(objectClass=user)" sn cn mail and it is working
but if i am running in bash script: #!/bin/bash BINDDN='CN=user,DC=domain,%3=local' ldapsearch -H ldap://server -w password -b "DC=domain,DC=local" -s sub -D $BINDDN -x "(objectClass=user)" sn cn mail
then: ldap_bind: Invalid credentials (49) additional info: 80090308: LdapErr: DSID-0C0903AA, comment: AcceptSecurityContext error, data 525, v1772
Bash variable do not work only for key -D, for other keys bash variable is working