From e60d7c7f2446356e88ca28c429c2f65ce7a7edd2 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 1 Nov 2005 09:47:30 +0000 Subject: [PATCH] fix incorrect bind error (ITS#4129) --- servers/slapd/back-meta/bind.c | 4 +++- tests/scripts/test035-meta | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index 071857d3c7..ccc5483dcc 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -184,7 +184,9 @@ meta_back_bind( Operation *op, SlapReply *rs ) rs->sr_err = lerr; candidates[ i ].sr_tag = META_NOT_CANDIDATE; - if ( META_BACK_ONERR_STOP( mi ) ) { + if ( lerr == LDAP_INVALID_CREDENTIALS + || META_BACK_ONERR_STOP( mi ) ) + { rc = rs->sr_err; break; } diff --git a/tests/scripts/test035-meta b/tests/scripts/test035-meta index c88b19de5b..895644f873 100755 --- a/tests/scripts/test035-meta +++ b/tests/scripts/test035-meta @@ -545,6 +545,29 @@ case $RC in ;; esac +echo "Binding with incorrect password to database \"$BASEDN\"..." +$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \ + -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \ + -w bogus >> $TESTOUT 2>&1 +RC=$? +#if test $RC != 0 ; then +# echo "WhoAmI failed ($RC)!" +# test $KILLSERVERS != no && kill -HUP $KILLPIDS +# exit $RC +#fi +case $RC in + 0) + echo "WhoAmI should have failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 + ;; + 51) + echo "### Hit LDAP_BUSY problem; you may want to re-run the test" + ;; + *) + ;; +esac + echo "Comparing to database \"$BASEDN\"..." $LDAPCOMPARE -h $LOCALHOST -p $PORT3 \ "cn=Another Added Group,ou=Groups,$BASEDN" \ -- 2.39.5