]> git.sur5r.net Git - openldap/commitdiff
Do not attempt to map positive error codes returned by plugins to
authorLuke Howard <lukeh@openldap.org>
Mon, 11 Aug 2003 09:55:45 +0000 (09:55 +0000)
committerLuke Howard <lukeh@openldap.org>
Mon, 11 Aug 2003 09:55:45 +0000 (09:55 +0000)
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
servers/slapd/slapi/slapi_ext.c

index 8c7e1801adcecbb3215ceca865212d2084e24b5d..b4e99b988446e07952270cf630d1a04d76bff67c 100644 (file)
@@ -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;
                }
        }
index 86e4e2a398bf1f3b830fa32b7307292960b21d3c..c73bec57b1107f71416dbf95a797e0c88c40b4a9 100644 (file)
@@ -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;