Article 5Q5ZE A problem with Expect script LDAP password input

A problem with Expect script LDAP password input

by
artadam
from LinuxQuestions.org on (#5Q5ZE)
I have a problem with password input in ldapsearch command. I have script witch asks for LDAP password twice I have something like this except (expect_ldap.sh) script to enter LDAP password:

Code:#!/usr/bin/expect -d
set timeout -1
spawn sudo ./ldapu.sh

expect "Enter LDAP Password:"
sleep 1
send "password\r"

expect "Enter LDAP Password:"
sleep 1
send "password\r"

expect eofAnd it does not works with LDAP here is an output:

Code:ldap_bind: Invalid credentials (49)

additional info: 80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 52e, v1db1But when I run my ldapu.sh script and manually insert twice LDAP passwords all works fine.

Can anyone see the problem?
May be exists more correct way to solve this problem?

Thanks for your answers! :)latest?d=yIl2AUoC8zA latest?i=Kvt1Te6GKiw:ecnSZgOkGLI:F7zBnMy latest?i=Kvt1Te6GKiw:ecnSZgOkGLI:V_sGLiP latest?d=qj6IDK7rITs latest?i=Kvt1Te6GKiw:ecnSZgOkGLI:gIN9vFwKvt1Te6GKiw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments