Michael Ströder wrote:
Rick Stevens wrote:
I've created a fairly simple shell script that creates an appropriate LDIF file to add users to my database. It then calls "ldapadd" to add the user:
RES=`ldapadd -U root -w $LDAPPWD -f $OUTFILE`
However, when the script runs, the ldapadd is rejected with:
ldap_sasl_interactive_bind_s: Invalid credentials (49)
The EXACT SAME command (after the variables are expanded) run from the command line works fine.
Could you please check that it's *exactly* the same line by adding a line with "echo $RES" as test output to your script?
I actually had the script put the command into a variable and echoed the variable. I cut-and-pasted the output into another xterm and it worked. That's why I'm confused.
Here's an example:
From the script: -------------------------------------------------------------------- Adding user to LDAP database...Command is ldapadd -U root -w 'FuNkyP@sswd' -f /tmp/userdata.ldif SASL/DIGEST-MD5 authentication started ldap_sasl_interactive_bind_s: Invalid credentials (49) additional info: SASL(-13): authentication failure: client response doesn't match what we generated --------------------------------------------------------------------
And if I cut-n-paste the command: -------------------------------------------------------------------- ldapadd -U root -w 'FuNkyP@sswd' -f /tmp/userdata.ldif SASL/DIGEST-MD5 authentication started SASL username: root SASL SSF: 128 SASL installing layers adding new entry "cn=testuser,ou=Group,dc=billing,dc=com"
adding new entry "uid=testuser,ou=People,dc=billing,dc=com" --------------------------------------------------------------------
Both script and command-line insertion executed as root. You see my dilemma.
---------------------------------------------------------------------- - Rick Stevens, Unix Geek rps2@socal.rr.com - - - - Veni, Vidi, VISA: I came, I saw, I did a little shopping. - ----------------------------------------------------------------------