]> git.sur5r.net Git - openldap/commitdiff
Conform SLAPI to Netscape, iPlanet and Sun ONE Directory Server
authorLuke Howard <lukeh@openldap.org>
Mon, 20 Jan 2003 23:18:11 +0000 (23:18 +0000)
committerLuke Howard <lukeh@openldap.org>
Mon, 20 Jan 2003 23:18:11 +0000 (23:18 +0000)
behaviour:

1. Plugins never return LDAP result codes, instead they return a
   small integer (0 or -1, others for special cases)
2. Preoperation plugins can abort processing by returning a non-
   zero value to the frontend
3. Postoperation plugins never abort processing (all are called)
   and their return values are ignored

12 files changed:
servers/slapd/add.c
servers/slapd/backend.c
servers/slapd/bind.c
servers/slapd/compare.c
servers/slapd/delete.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/result.c
servers/slapd/search.c
servers/slapd/slapi/slapi.h
servers/slapd/slapi/slapi_pblock.c
servers/slapd/slapi/slapi_utils.c

index 46de08c9351dc46bfa03d725e0fafb431ed9701f..0db53d78f4e28b5a384d8ca9e48728fd58ec03a5 100644 (file)
@@ -234,19 +234,20 @@ do_add( Connection *conn, Operation *op )
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_ADD_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != 0 ) {
                /*
-                * either there is no preOp (add) plugins
-                * or a plugin failed. Just log it
-                * 
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_add: add preOps failed\n",
+               LDAP_LOG( OPERATION, INFO, "do_add: add preoperation plugin failed\n",
                                0, 0, 0);
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_add: add preOps failed.\n",
+               Debug(LDAP_DEBUG_TRACE, "do_add: add preoperation plugin failed.\n",
                                0, 0, 0);
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 )
+                       rc = LDAP_OPERATIONS_ERROR;
+               goto done;
 #endif
        }
 #endif /* defined( LDAP_SLAPI ) */
@@ -338,19 +339,16 @@ do_add( Connection *conn, Operation *op )
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_ADD_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no postOp (Add) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       /*
+        * Postoperation errors are silently ignored; the work has
+        * been done.
+        */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_ADD_FN, pb ) != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_add: Add postOps failed\n",
+               LDAP_LOG( OPERATION, INFO, "do_add: Add postoperation plugins failed\n",
                                0, 0, 0);
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_add: Add postOps failed.\n",
+               Debug(LDAP_DEBUG_TRACE, "do_add: Add postoperation plugins failed.\n",
                                0, 0, 0);
 #endif
        }
index d990ac2da5e7f4ebd143c645753ae51963be6ebc..ee8b3809d33e3ee8563fdbbe05df802106c03018 100644 (file)
@@ -702,20 +702,19 @@ backend_unbind(
                slapi_pblock_set( pb, SLAPI_BACKEND, (void *)&backends[i] );
                rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_PRE_UNBIND_FN,
                                (Slapi_PBlock *)pb );
-               if ( rc != 0 && rc != LDAP_OTHER ) {
+               if ( rc != 0 ) {
                        /*
-                        * either there is no preOp (unbind) plugins
-                        * or a plugin failed. Just log it.
-                        *
-                        * FIXME: is this correct?
+                        * A preoperation plugin failure will abort the
+                        * entire operation.
                         */
 #ifdef NEW_LOGGING
-                       LDAP_LOG( OPERATION, INFO, "do_bind: Unbind preOps "
+                       LDAP_LOG( OPERATION, INFO, "do_bind: Unbind preoperation plugin "
                                        "failed\n", 0, 0, 0);
 #else
-                       Debug(LDAP_DEBUG_TRACE, "do_bind: Unbind preOps "
+                       Debug(LDAP_DEBUG_TRACE, "do_bind: Unbind preoperation plugin "
                                        "failed.\n", 0, 0, 0);
 #endif
+                       return 0;
                }
 #endif /* defined( LDAP_SLAPI ) */
 
@@ -724,20 +723,13 @@ backend_unbind(
                }
 
 #if defined( LDAP_SLAPI )
-               rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN,
-                               (Slapi_PBlock *)pb );
-               if ( rc != 0 && rc != LDAP_OTHER ) {
-                       /*
-                        * either there is no postOp (unbind) plugins
-                        * or a plugin failed. Just log it.
-                        *
-                        * FIXME: is this correct?
-                        */
+               if ( doPluginFNs( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN,
+                               (Slapi_PBlock *)pb ) != 0 ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG( OPERATION, INFO, "do_unbind: Unbind postOps "
+                       LDAP_LOG( OPERATION, INFO, "do_unbind: Unbind postoperation plugins "
                                        "failed\n", 0, 0, 0);
 #else
-                       Debug(LDAP_DEBUG_TRACE, "do_unbind: Unbind postOps "
+                       Debug(LDAP_DEBUG_TRACE, "do_unbind: Unbind postoperation plugins "
                                        "failed.\n", 0, 0, 0);
 #endif
                }
index b264c46607883dc1710bd5de1de7d155b49a891e..9c9b9f8f9e86ac14743d4440dd0dd1551ca393e8 100644 (file)
@@ -545,20 +545,22 @@ do_bind(
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_BIND_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != SLAPI_BIND_SUCCESS ) {
+               /* XXX: we should support SLAPI_BIND_ANONYMOUS being returned */
                /*
-                * either there is no preOp (bind) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_bind: Bind preOps failed\n",
+               LDAP_LOG( OPERATION, INFO, "do_bind: Bind preoperation plugin failed\n",
                                0, 0, 0);
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_bind: Bind preOps failed.\n",
+               Debug(LDAP_DEBUG_TRACE, "do_bind: Bind preoperation plugin failed.\n",
                                0, 0, 0);
 #endif
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 )
+                       rc = LDAP_OPERATIONS_ERROR;
+               goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
 
@@ -629,19 +631,12 @@ do_bind(
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_BIND_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no pretOp (bind) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_BIND_FN, pb ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_bind: Bind postOps failed\n",
+               LDAP_LOG( OPERATION, INFO, "do_bind: Bind postoperation plugins failed\n",
                                0, 0, 0);
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_bind: Bind postOps failed.\n",
+               Debug(LDAP_DEBUG_TRACE, "do_bind: Bind postoperation plugins failed.\n",
                                0, 0, 0);
 #endif
        }
index c1f3db3f9ca161ae8663fbf8371d9af86cd7ea6c..f50c58c3801afd3bfb86d230b415e527f74a4b21 100644 (file)
@@ -281,20 +281,21 @@ do_compare(
        slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&value );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_COMPARE_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != 0 ) {
                /*
-                * either there is no preOp (compare) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_compare: compare preOps "
+               LDAP_LOG( OPERATION, INFO, "do_compare: compare preoperation plugin "
                                "failed\n", 0, 0, 0);
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_compare: compare preOps "
+               Debug(LDAP_DEBUG_TRACE, "do_compare: compare preoperation plugin "
                                "failed.\n", 0, 0, 0);
 #endif
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0)
+                       rc = LDAP_OPERATIONS_ERROR;
+               goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
 
@@ -307,19 +308,12 @@ do_compare(
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_COMPARE_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no postOp (compare) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_compare: compare postOps "
+               LDAP_LOG( OPERATION, INFO, "do_compare: compare postoperation plugins "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_compare: compare postOps "
+               Debug(LDAP_DEBUG_TRACE, "do_compare: compare postoperation plugins "
                                "failed.\n", 0, 0, 0);
 #endif
        }
index acab86bba69a198d16b17280ec9b1dde16206b07..012a1d71c229c00305171518027f062294b2959d 100644 (file)
@@ -165,20 +165,21 @@ do_delete(
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_DELETE_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != 0 ) {
                /*
-                * either there is no preOp (delete) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_delete: delete preOps "
+               LDAP_LOG( OPERATION, INFO, "do_delete: delete preoperation plugin "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug (LDAP_DEBUG_TRACE, "do_delete: delete preOps failed.\n",
+               Debug (LDAP_DEBUG_TRACE, "do_delete: delete preoperation plugin failed.\n",
                                0, 0, 0);
 #endif
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 )
+                       rc = LDAP_OPERATIONS_ERROR;
+               goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
 
@@ -223,19 +224,12 @@ do_delete(
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_DELETE_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no postOp (delete) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_DELETE_FN, pb ) != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_delete: delete postOps "
+               LDAP_LOG( OPERATION, INFO, "do_delete: delete postoperation plugins "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_delete: delete postOps "
+               Debug(LDAP_DEBUG_TRACE, "do_delete: delete postoperation plugins "
                                "failed.\n", 0, 0, 0);
 #endif
        }
index 9cc0f0d00b43dd7b72da312f0ae15bb73d87dac7..cf06590296596a615b186e4bd5e33d248839af0f 100644 (file)
@@ -348,20 +348,21 @@ do_modify(
        slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_MODIFY_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != 0 ) {
                /*
-                * either there is no preOp (modify) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_modify: modify preOps "
+               LDAP_LOG( OPERATION, INFO, "do_modify: modify preoperation plugin "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_modify: modify preOps failed.\n",
+               Debug(LDAP_DEBUG_TRACE, "do_modify: modify preoperation plugin failed.\n",
                                0, 0, 0);
 #endif
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0)
+                       rc = LDAP_OPERATIONS_ERROR;
+               goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
 
@@ -443,19 +444,12 @@ do_modify(
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_MODIFY_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no postOp (modify) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_MODIFY_FN, pb ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_modify: modify postOps "
+               LDAP_LOG( OPERATION, INFO, "do_modify: modify postoperation plugins "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_modify: modify postOps "
+               Debug(LDAP_DEBUG_TRACE, "do_modify: modify postoperation plugins "
                                "failed.\n", 0, 0, 0);
 #endif
        }
index 1238050cb1baa8653dc357bb7ae0b5d12cdd55fc..d2f53ad977aaf2016905736cbc32dd907fe56666 100644 (file)
@@ -340,20 +340,21 @@ do_modrdn(
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_MODRDN_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != 0 ) {
                /*
-                * either there is no preOp (modrdn) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn preOps "
+               LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn preoperation plugin "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn preOps "
+               Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn preoperation plugin "
                                "failed.\n", 0, 0, 0);
 #endif
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0)
+                       rc = LDAP_OPERATIONS_ERROR;
+               goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
 
@@ -404,19 +405,12 @@ do_modrdn(
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_MODRDN_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no postOp (modrdn) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn postOps "
+               LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn postoperation plugins "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn postOps "
+               Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn postoperation plugins "
                                "failed.\n", 0, 0, 0);
 #endif
        }
index 0fe739a732380ae6fc06fdd5a555b0400d0a066b..97abca094e7ba8adc07f3fd30afa6ac60f92c600 100644 (file)
@@ -240,7 +240,7 @@ send_ldap_response(
                        text, ref, resoid, resdata, sasldata, ctrls );
                return;
        }
-               
+
        ber_init_w_nullc( ber, LBER_USE_DER );
 
 #ifdef NEW_LOGGING
index 8a1cac660ba1bca78359b88639d087ff470de3f2..151505f708edfa5d3393b21030908e32c7467bda 100644 (file)
@@ -354,21 +354,22 @@ do_search(
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
 
        rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_SEARCH_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
+       if ( rc != 0 ) {
                /*
-                * either there is no preOp (search) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
+                * A preoperation plugin failure will abort the
+                * entire operation.
                 */
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_search: search preOps "
+               LDAP_LOG( OPERATION, INFO, "do_search: search preoperation plugin "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_search: search preOps "
+               Debug(LDAP_DEBUG_TRACE, "do_search: search preoperation plugin "
                                "failed.\n", 0, 0, 0);
 #endif
-    }
+               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0)
+                       rc = LDAP_OPERATIONS_ERROR;
+               return rc;
+       }
 #endif /* defined( LDAP_SLAPI ) */
 
        /* actually do the search and send the result(s) */
@@ -383,22 +384,15 @@ do_search(
        }
 
 #if defined( LDAP_SLAPI )
-       rc = doPluginFNs( be, SLAPI_PLUGIN_POST_SEARCH_FN, pb );
-       if ( rc != 0 && rc != LDAP_OTHER ) {
-               /*
-                * either there is no postOp (search) plugins
-                * or a plugin failed. Just log it
-                *
-                * FIXME: is this correct?
-                */
+       if ( doPluginFNs( be, SLAPI_PLUGIN_POST_SEARCH_FN, pb ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG( OPERATION, INFO, "do_search: search postOps "
+               LDAP_LOG( OPERATION, INFO, "do_search: search postoperation plugins "
                                "failed\n", 0, 0, 0 );
 #else
-               Debug(LDAP_DEBUG_TRACE, "do_search: search postOps "
+               Debug(LDAP_DEBUG_TRACE, "do_search: search postoperation plugins "
                                "failed.\n", 0, 0, 0);
 #endif
-    }
+       }
 #endif /* defined( LDAP_SLAPI ) */
 
 return_results:;
index 4e5ea29addf1cfefc926a98a298835b00db8aded..ad8ecec046438158292926d533d9e0363a27c13a 100644 (file)
@@ -50,6 +50,10 @@ LDAP_BEGIN_DECL
 #define SLAPI_PLUGIN_EXTENDED_SENT_RESULT       -1
 #define SLAPI_PLUGIN_EXTENDED_NOT_HANDLED       -2
 
+#define SLAPI_BIND_SUCCESS             0
+#define SLAPI_BIND_FAIL                        2
+#define SLAPI_BIND_ANONYMOUS           3
+
 #define SLAPI_BACKEND                          130
 #define SLAPI_CONNECTION                       131
 #define SLAPI_OPERATION                                132
@@ -180,6 +184,10 @@ LDAP_BEGIN_DECL
 #define SLAPI_PLUGIN_SYNTAX_FLAGS              707
 #define SLAPI_PLUGIN_SYNTAX_COMPARE            708
 
+#define SLAPI_RESULT_CODE                      881
+#define SLAPI_RESULT_TEXT                      882
+#define SLAPI_RESULT_MATCHED                   883
+
 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORKEYS                        1
 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING              2
 
index 2df1f3bd4ecd8c0e7a9f9536662e128992481c97..4418f7eeb5e408640de54eb30115631d83f19c15 100644 (file)
@@ -367,6 +367,18 @@ slapi_pblock_destroy( Slapi_PBlock* pb )
                ch_free( str );
        }
 
+       get( pb, SLAPI_RESULT_TEXT, (void **)&str );
+       if ( str != NULL ) {
+               ch_free( str );
+               str = NULL;
+       }
+
+       get( pb, SLAPI_RESULT_MATCHED, (void **)&str );
+       if ( str != NULL ) {
+               ch_free( str );
+               str = NULL;
+       }
+
        ldap_pvt_thread_mutex_destroy( &pb->pblockMutex );
 
        ch_free( pb ); 
index cc4fa53af1c1ab21dcfb4f390689bd2bc0bc8a08..db1907b9561c82c61ab01c394b73aa4f328eb228 100644 (file)
@@ -705,6 +705,10 @@ slapi_send_ldap_result(
                return;
        }
 
+       slapi_pblock_set( pb, SLAPI_RESULT_CODE, (void *)err);
+       slapi_pblock_set( pb, SLAPI_RESULT_MATCHED, ( matched != NULL ) ? (void *)ch_strdup( matched ) : NULL );
+       slapi_pblock_set( pb, SLAPI_RESULT_TEXT, ( text != NULL ) ? (void *)ch_strdup( text ) : NULL );
+
        send_ldap_result( conn, op, err, matched, text, NULL, NULL );
 #endif /* defined(LDAP_SLAPI) */
 }