mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
Don't leak SLAPI_RESULT_MATCHED
Call SLAPI_PLUGIN_PRE_RESULT_FN plugins
This commit is contained in:
parent
613f493cae
commit
ce17fd5f04
1 changed files with 16 additions and 3 deletions
|
|
@ -372,9 +372,8 @@ send_ldap_response(
|
||||||
|
|
||||||
#ifdef LDAP_SLAPI
|
#ifdef LDAP_SLAPI
|
||||||
slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
|
slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
|
||||||
slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, ( rs->sr_matched != NULL ) ? (void *)ch_strdup( rs->sr_matched ) : NULL );
|
slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
|
||||||
/* RESULT_TEXT is dup'd by pblock_set */
|
slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
|
||||||
slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, rs->sr_text );
|
|
||||||
#endif /* LDAP_SLAPI */
|
#endif /* LDAP_SLAPI */
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &num_sent_mutex );
|
ldap_pvt_thread_mutex_lock( &num_sent_mutex );
|
||||||
|
|
@ -488,6 +487,20 @@ slap_send_ldap_result( Operation *op, SlapReply *rs )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LDAP_SLAPI
|
||||||
|
/*
|
||||||
|
* Call pre-result plugins. To avoid infinite recursion plugins
|
||||||
|
* should just set SLAPI_RESULT_CODE rather than sending a
|
||||||
|
* result if they wish to change the result.
|
||||||
|
*/
|
||||||
|
slapi_x_pblock_set_operation( op->o_pb, op );
|
||||||
|
slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
|
||||||
|
slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
|
||||||
|
slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
|
||||||
|
|
||||||
|
(void) doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_RESULT_FN, op->o_pb );
|
||||||
|
#endif /* LDAP_SLAPI */
|
||||||
|
|
||||||
if ( op->o_protocol < LDAP_VERSION3 ) {
|
if ( op->o_protocol < LDAP_VERSION3 ) {
|
||||||
tmp = v2ref( rs->sr_ref, rs->sr_text );
|
tmp = v2ref( rs->sr_ref, rs->sr_text );
|
||||||
rs->sr_text = tmp;
|
rs->sr_text = tmp;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue