From: Pierangelo Masarati Date: Tue, 25 Apr 2006 19:07:34 +0000 (+0000) Subject: callbacks must return valid error codes (ITS#4499) X-Git-Tag: OPENLDAP_REL_ENG_2_4_1ALPHA~2^2~151 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=004b69d070cd366167100a13b18e22b7c0b6c270;p=openldap callbacks must return valid error codes (ITS#4499) --- diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 9b8a07f825..dec0041415 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -1570,24 +1570,25 @@ static int slap_authz_regexp( struct berval *in, struct berval *out, } /* This callback actually does some work...*/ -static int sasl_sc_sasl2dn( Operation *o, SlapReply *rs ) +static int sasl_sc_sasl2dn( Operation *op, SlapReply *rs ) { - struct berval *ndn = o->o_callback->sc_private; + struct berval *ndn = op->o_callback->sc_private; - if (rs->sr_type != REP_SEARCH) return 0; + if ( rs->sr_type != REP_SEARCH ) return LDAP_SUCCESS; /* We only want to be called once */ if ( !BER_BVISNULL( ndn ) ) { - o->o_tmpfree(ndn->bv_val, o->o_tmpmemctx); + op->o_tmpfree( ndn->bv_val, op->o_tmpmemctx ); BER_BVZERO( ndn ); Debug( LDAP_DEBUG_TRACE, - "slap_sc_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 ); - return -1; + "%s: slap_sc_sasl2dn: search DN returned more than 1 entry\n", + op->o_log_prefix, 0, 0 ); + return LDAP_OTHER; } - ber_dupbv_x(ndn, &rs->sr_entry->e_nname, o->o_tmpmemctx); - return 0; + ber_dupbv_x( ndn, &rs->sr_entry->e_nname, op->o_tmpmemctx ); + return LDAP_SUCCESS; }