From 281627d81d2b1862e7d86d8d4f8d8545bd0ff7e4 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 11 Aug 2003 09:55:45 +0000 Subject: [PATCH] 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 ... --- servers/slapd/slapi/plugin.c | 7 +++++-- servers/slapd/slapi/slapi_ext.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.5