From 485d7b44858a0ad227e38f937c490eafb348f2cd Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Mon, 10 Nov 2008 18:24:38 +0000 Subject: [PATCH] ITS#5742 --- servers/slapd/back-ldap/chain.c | 5 ++++- tests/scripts/test032-chain | 27 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-ldap/chain.c b/servers/slapd/back-ldap/chain.c index ffdf61fe5c..808561f071 100644 --- a/servers/slapd/back-ldap/chain.c +++ b/servers/slapd/back-ldap/chain.c @@ -597,6 +597,8 @@ ldap_chain_search( struct berval odn = op->o_req_dn, ondn = op->o_req_ndn; slap_response *save_response = op->o_callback->sc_response; + Entry *save_entry = rs->sr_entry; + slap_mask_t save_flags = rs->sr_flags; int rc = LDAP_OTHER, first_rc = -1; @@ -761,7 +763,8 @@ further_cleanup:; op->o_req_ndn = ondn; op->o_callback->sc_response = save_response; rs->sr_type = REP_SEARCHREF; - rs->sr_entry = NULL; + rs->sr_entry = save_entry; + rs->sr_flags = save_flags; if ( rc != LDAP_SUCCESS ) { /* couldn't chase any of the referrals */ diff --git a/tests/scripts/test032-chain b/tests/scripts/test032-chain index 2a7f684346..1a8190ed56 100755 --- a/tests/scripts/test032-chain +++ b/tests/scripts/test032-chain @@ -128,7 +128,7 @@ for P in $PORT1 $PORT2 ; do exit 1 fi - echo "Reading the referral entry "ou=Other,$BASEDN" as anonymous on port $P..." + echo "Reading the referral entry \"ou=Other,$BASEDN\" as anonymous on port $P..." $LDAPSEARCH -h $LOCALHOST -p $P -b "ou=Other,$BASEDN" -S "" \ > $SEARCHOUT 2>&1 @@ -304,6 +304,31 @@ if test $RC != 0 ; then exit $RC fi +# ITS#57?? +$LDAPADD -h $LOCALHOST -p $PORT1 \ + -D "$MANAGERDN" -w secret \ + >> $TESTOUT 2>&1 \ + << EOMODS +dn: ou=Can't Contact,dc=example,dc=com +changetype: add +objectclass: referral +objectclass: extensibleobject +ou: Can't Contact +# invalid URI to test broken connectivity handling (search only) +ref: ${URI3}ou=Can't%20Contact,dc=example,dc=com +EOMODS + +echo "Reading the referral entry \"ou=Can't Contact,$BASEDN\" as anonymous on port $PORT1..." +$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" -S "" "(cn=Can't Contact)" \ + > $SEARCHOUT 2>&1 + +RC=$? +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" -- 2.39.5