From: Kurt Zeilenga Date: Wed, 27 Sep 2000 23:25:15 +0000 (+0000) Subject: Fix referrals no-referrals case X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1875 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=45b0ae2e7d8bee3826c7b05759ab0a874165928c;p=openldap Fix referrals no-referrals case --- diff --git a/servers/slapd/back-bdb/Makefile.in b/servers/slapd/back-bdb/Makefile.in index 12af61da0c..acf87952dc 100644 --- a/servers/slapd/back-bdb/Makefile.in +++ b/servers/slapd/back-bdb/Makefile.in @@ -1,10 +1,12 @@ # $OpenLDAP$ SRCS = init.c tools.c config.c \ - add.c bind.c compare.c delete.c search.c \ + add.c bind.c compare.c delete.c modify.c modrdn.c search.c \ + extended.c passwd.c referral.c \ dn2entry.lo dn2id.c error.c id2entry.c idl.c nextid.c OBJS = init.lo tools.lo config.lo \ - add.lo bind.lo compare.lo delete.lo search.lo \ + add.lo bind.lo compare.lo delete.lo modify.lo modrdn.lo search.lo \ + extended.lo passwd.lo referral.lo \ dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo nextid.lo LDAP_INCDIR= ../../../include diff --git a/servers/slapd/back-bdb/referral.c b/servers/slapd/back-bdb/referral.c index f4e2a08c70..b969ce966f 100644 --- a/servers/slapd/back-bdb/referral.c +++ b/servers/slapd/back-bdb/referral.c @@ -1,4 +1,4 @@ -/* referral.c - LDBM backend referral handler */ +/* referral.c - BDB backend referral handler */ /* $OpenLDAP$ */ /* * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved. @@ -23,7 +23,7 @@ bdb_referrals( { struct bdb_info *bdb = (struct bdb_info *) be->be_private; int rc = LDAP_SUCCESS; - Entry *e, *matched; + Entry *e = NULL, *matched; if( op->o_tag == LDAP_REQ_SEARCH ) { /* let search take care of itself */ @@ -43,6 +43,9 @@ bdb_referrals( case 0: break; default: + Debug( LDAP_DEBUG_TRACE, + "bdb_referrals: dn2entry failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); send_ldap_result( conn, op, rc=LDAP_OTHER, NULL, "internal error", NULL, NULL ); return rc; @@ -56,7 +59,7 @@ bdb_referrals( matched_dn = ch_strdup( matched->e_dn ); Debug( LDAP_DEBUG_TRACE, - "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", + "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", op->o_tag, dn, matched_dn ); refs = is_entry_referral( matched ) @@ -70,6 +73,8 @@ bdb_referrals( /* send referrals */ send_ldap_result( conn, op, rc = LDAP_REFERRAL, matched_dn, NULL, refs, NULL ); + } else { + rc = LDAP_SUCCESS; } if( matched != NULL ) { @@ -86,7 +91,7 @@ bdb_referrals( conn, op, e ); Debug( LDAP_DEBUG_TRACE, - "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", + "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", op->o_tag, dn, e->e_dn ); if( refs != NULL ) {