int rc;
rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_ADD_FN, op->o_pb );
- if ( rc != 0 ) {
+ if ( rc < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
int rc;
rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_ADD_FN, op->o_pb );
- if ( rc != 0 ) {
+ if ( rc < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_add: add postoperation plugin failed\n",
0, 0, 0);
slapi_pblock_set( pb, SLAPI_BACKEND, (void *)&backends[i] );
rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_PRE_UNBIND_FN,
(Slapi_PBlock *)pb );
- if ( rc != 0 ) {
+ if ( rc < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
#if defined( LDAP_SLAPI )
if ( doPluginFNs( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN,
- (Slapi_PBlock *)pb ) != 0 ) {
+ (Slapi_PBlock *)pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_unbind: Unbind postoperation plugins "
"failed\n", 0, 0, 0);
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
- if ( rs->sr_err != SLAPI_BIND_SUCCESS ) {
+ if ( rs->sr_err < 0 ) {
/*
* Binding is a special case for SLAPI plugins. It is
* possible for a bind plugin to be successful *and*
}
#if defined( LDAP_SLAPI )
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) != 0 ) {
+ if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_bind: Bind postoperation plugins failed\n",
0, 0, 0);
slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&value );
rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_COMPARE_FN, pb );
- if ( rs->sr_err != 0 ) {
+ if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
}
#if defined( LDAP_SLAPI )
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) != 0 ) {
+ if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_compare: compare postoperation plugins "
"failed\n", 0, 0, 0 );
slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_MODIFY_FN, pb );
- if ( rs->sr_err != 0 ) {
+ if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
* Calling slapi_x_modifications2ldapmods() destroyed modlist so
* we don't need to free it.
*/
- slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
- modlist = slapi_x_ldapmods2modifications( modv );
+ if ( rs->sr_err == 0 ) {
+ slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv );
+ modlist = slapi_x_ldapmods2modifications( modv );
/*
* NB: it is valid for the plugin to return no modifications
* then slapi_x_ldapmods2modifications() above will return
* NULL).
*/
- if ( modlist == NULL ) {
- rs->sr_err = LDAP_SUCCESS;
- send_ldap_result( op, rs );
- goto cleanup;
+ if ( modlist == NULL ) {
+ rs->sr_err = LDAP_SUCCESS;
+ send_ldap_result( op, rs );
+ goto cleanup;
+ }
}
#endif /* defined( LDAP_SLAPI ) */
}
#if defined( LDAP_SLAPI )
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_MODIFY_FN, pb ) != 0 ) {
+ if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_MODIFY_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_modify: modify postoperation plugins "
"failed\n", 0, 0, 0 );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_MODRDN_FN, pb );
- if ( rs->sr_err != 0 ) {
+ if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
}
#if defined( LDAP_SLAPI )
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) != 0 ) {
+ if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn postoperation plugins "
"failed\n", 0, 0, 0 );
int rc;
rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_SEARCH_FN, op->o_pb );
- if ( rc != 0 ) {
+ if ( rc < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
static void doPostSearchPluginFNs( Operation *op )
{
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) != 0 ) {
+ if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "doPostSearchPluginFNs: search postoperation plugins "
"failed\n", 0, 0, 0 );
* failure (confirmed with SLAPI specification).
*/
if ( !SLAPI_PLUGIN_IS_POST_FN( funcType ) && rc != 0 ) {
+ /* make sure errors are negative */
+ if ( rc > 0 ) rc = 0 - rc;
break;
}
}