]> git.sur5r.net Git - openldap/commitdiff
A pre-operation plugin is not required to set SLAPI_RESULT_CODE in
authorLuke Howard <lukeh@openldap.org>
Wed, 30 Apr 2003 13:37:14 +0000 (13:37 +0000)
committerLuke Howard <lukeh@openldap.org>
Wed, 30 Apr 2003 13:37:14 +0000 (13:37 +0000)
order to prevent the operation from being passed to the backend. It
need only return a non-zero error code.

servers/slapd/add.c
servers/slapd/bind.c
servers/slapd/compare.c
servers/slapd/delete.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/search.c

index fa61285c4a74e8bb6bd1ce7476ee3fc1ed3ef875..1ff6ed0cc616a8f84859cc4d468180fc3fdd2f8c 100644 (file)
@@ -556,8 +556,10 @@ static int doPreAddPluginFNs( Operation *op )
 #else
                Debug(LDAP_DEBUG_TRACE, "do_add: add preoperation plugin failed.\n",
                                0, 0, 0);
-               if ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 )
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) ||
+                    rc == LDAP_SUCCESS ) {
                        rc = LDAP_OTHER;
+               }
 #endif
        } else {
                rc = LDAP_SUCCESS;
index 93aedd309968adb2884db4e7d5160c5700b69956..9641d863c22373568b3120eabf30e59da6ead878 100644 (file)
@@ -540,9 +540,10 @@ do_bind(
                 */
                int ldapRc;
 
-               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&ldapRc ) != 0 )
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&ldapRc ) != 0 ) ||
+                    ldapRc == LDAP_SUCCESS ) {
                        ldapRc = LDAP_OTHER;
-
+               }
                op->orb_edn.bv_val = NULL;
                op->orb_edn.bv_len = 0;
                if ( rs->sr_err != SLAPI_BIND_FAIL && ldapRc == LDAP_SUCCESS ) {
index fac29badddd33af8bb3c745c2f6c75dd839667fa..abd1c2d42602aaff11d150204dc32dae71bafbb0 100644 (file)
@@ -272,8 +272,10 @@ do_compare(
                Debug(LDAP_DEBUG_TRACE, "do_compare: compare preoperation plugin "
                                "failed.\n", 0, 0, 0);
 #endif
-               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0)
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 )  ||
+                    rs->sr_err == LDAP_SUCCESS ) {
                        rs->sr_err = LDAP_OTHER;
+               }
                goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
index 4ef2a53b80d46854fafc10c1f30e4df016afd925..30e1294a6963dfab5bea0a410d03e911d7909ca5 100644 (file)
@@ -173,8 +173,10 @@ do_delete(
                Debug (LDAP_DEBUG_TRACE, "do_delete: delete preoperation plugin failed.\n",
                                0, 0, 0);
 #endif
-               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 )
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 )  ||
+                    rs->sr_err == LDAP_SUCCESS ) {
                        rs->sr_err = LDAP_OTHER;
+               }
                goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
index df77beaf1521112430139a5c6a32f14f32bcf7d1..f8b1d7b8724f1afce95d60fe11e88872952e36dd 100644 (file)
@@ -347,7 +347,8 @@ do_modify(
                Debug(LDAP_DEBUG_TRACE, "do_modify: modify preoperation plugin failed.\n",
                                0, 0, 0);
 #endif
-               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0) {
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 )  ||
+                    rs->sr_err == LDAP_SUCCESS ) {
                        rs->sr_err = LDAP_OTHER;
                }
                slapi_x_free_ldapmods( modv );
index 0644a8995a8d56a76615c016fd3719d9cc0e934f..6babf195a61f734d315bdea7cdabac1ab62d7756 100644 (file)
@@ -336,8 +336,10 @@ do_modrdn(
                Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn preoperation plugin "
                                "failed.\n", 0, 0, 0);
 #endif
-               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0)
+               if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) ||
+                    rs->sr_err == LDAP_SUCCESS ) {
                        rs->sr_err = LDAP_OTHER;
+               }
                goto cleanup;
        }
 #endif /* defined( LDAP_SLAPI ) */
index 1d53226ce0f25ca059fba3d66791f02e4a0696fa..c033b1fe7be8f853182118b66883ad88f3727b63 100644 (file)
@@ -482,8 +482,10 @@ static int doPreSearchPluginFNs( Operation *op )
                Debug(LDAP_DEBUG_TRACE, "doPreSearchPluginFNs: search preoperation plugin "
                                "returned %d.\n", rc, 0, 0);
 #endif
-               if ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0)
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) ||
+                    rc == LDAP_SUCCESS ) {
                        rc = LDAP_OTHER;
+               }
        } else {
                rc = LDAP_SUCCESS;
        }