From: Luke Howard Date: Mon, 11 Aug 2003 09:55:45 +0000 (+0000) Subject: Do not attempt to map positive error codes returned by plugins to X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~798 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=281627d81d2b1862e7d86d8d4f8d8545bd0ff7e4;p=openldap Do not attempt to map positive error codes returned by plugins to negative error codes. Plugins should never return positive error codes except in the case of bind pre-operation plugins, where they should return SLAPI_BIND_XXX. This should fix ITS #2616 ... --- diff --git a/servers/slapd/slapi/plugin.c b/servers/slapd/slapi/plugin.c index 8c7e1801ad..b4e99b9884 100644 --- a/servers/slapd/slapi/plugin.c +++ b/servers/slapd/slapi/plugin.c @@ -637,8 +637,11 @@ doPluginFNs( * 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; + /* + * Plugins generally return negative error codes + * to indicate failure, although in the case of + * bind plugins they may return SLAPI_BIND_xxx + */ break; } } diff --git a/servers/slapd/slapi/slapi_ext.c b/servers/slapd/slapi/slapi_ext.c index 86e4e2a398..c73bec57b1 100644 --- a/servers/slapd/slapi/slapi_ext.c +++ b/servers/slapd/slapi/slapi_ext.c @@ -330,7 +330,7 @@ int slapi_x_clear_object_extensions(int objecttype, void *object) } for ( i = 0; i < registered_extensions.extensions[objecttype].count; i++ ) { - newExtension( eblock, objecttype, object, parent, i ); + newExtension( eblock, objecttype, object, parent, i ); } return 0;