]> git.sur5r.net Git - openldap/commitdiff
Mark Sun ONE 5.x SLAPI plugin types to avoid collisions
authorLuke Howard <lukeh@openldap.org>
Tue, 21 Jan 2003 02:46:55 +0000 (02:46 +0000)
committerLuke Howard <lukeh@openldap.org>
Tue, 21 Jan 2003 02:46:55 +0000 (02:46 +0000)
Rename internal slapi_XXX API to slapi_x_XXX
Always set result code/matched/error text in operation parameter block
to make available to postoperation plugins

13 files changed:
servers/slapd/add.c
servers/slapd/backend.c
servers/slapd/bind.c
servers/slapd/compare.c
servers/slapd/delete.c
servers/slapd/extended.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_utils.c
servers/slapd/slapi/slapi_utils.h

index 0db53d78f4e28b5a384d8ca9e48728fd58ec03a5..9c55df9f79b0b4f6e4bbdc696b1afa1e48fecc5a 100644 (file)
@@ -226,9 +226,9 @@ do_add( Connection *conn, Operation *op )
        }
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_ADD_ENTRY, (void *)e );
        slapi_pblock_set( pb, SLAPI_ADD_TARGET, (void *)dn.bv_val );
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
index ee8b3809d33e3ee8563fdbbe05df802106c03018..7d3aea77e389bb45b8f9773443943d2fc808def9 100644 (file)
@@ -693,8 +693,8 @@ backend_unbind(
 
 #if defined( LDAP_SLAPI )
        int     rc;
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
 #endif /* defined( LDAP_SLAPI ) */
 
        for ( i = 0; i < nbackends; i++ ) {
index 9c9b9f8f9e86ac14743d4440dd0dd1551ca393e8..f444b9516d92171f7c0ab853b932b535b1cf8441 100644 (file)
@@ -537,9 +537,9 @@ do_bind(
        }
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
        slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
index f50c58c3801afd3bfb86d230b415e527f74a4b21..c9b328060f58e81e4d79de3c4a56535905f67a40 100644 (file)
@@ -272,9 +272,9 @@ do_compare(
        suffix_alias( be, &ndn );
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_COMPARE_TARGET, (void *)dn.bv_val );
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
        slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)desc.bv_val );
index 012a1d71c229c00305171518027f062294b2959d..a431c080ddeb022fb9c927f2ff43f39907a8c934 100644 (file)
@@ -158,9 +158,9 @@ do_delete(
        suffix_alias( be, &ndn );
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_DELETE_TARGET, (void *)dn.bv_val );
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
 
index 481e22b962a685d3b761a4066812af6b7ef23e6c..c5ca7dca8267d29c14a08e144ab64cd15ef4c4c6 100644 (file)
@@ -267,13 +267,13 @@ do_extended(
                        goto done;
                }
 
-               rc = slapi_connection_set_pb( pb, conn );
+               rc = slapi_x_connection_set_pb( pb, conn );
                if ( rc != LDAP_SUCCESS ) {
                        rc = LDAP_OPERATIONS_ERROR;
                        goto done;
                }
 
-               rc = slapi_operation_set_pb( pb, op );
+               rc = slapi_x_operation_set_pb( pb, op );
                if ( rc != LDAP_SUCCESS ) {
                        rc = LDAP_OPERATIONS_ERROR;
                        goto done;
index cf06590296596a615b186e4bd5e33d248839af0f..5ff9b1d875eb661d543f475e9b7618625f0ab9b6 100644 (file)
@@ -339,9 +339,9 @@ do_modify(
        suffix_alias( be, &ndn );
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_MODIFY_TARGET, (void *)dn.bv_val );
        slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) );
        modv = Modifications2LDAPMods( modlist );
index d2f53ad977aaf2016905736cbc32dd907fe56666..ffa7410a3650cdd2ec8f29686d792088cd172f32 100644 (file)
@@ -329,9 +329,9 @@ do_modrdn(
        suffix_alias( be, &ndn );
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_MODRDN_TARGET, (void *)dn.bv_val );
        slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN, (void *)newrdn.bv_val );
        slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR,
index 97abca094e7ba8adc07f3fd30afa6ac60f92c600..341040f8f4f8c2756a0b7b006bc63403027d41ed 100644 (file)
@@ -17,6 +17,7 @@
 #include <ac/unistd.h>
 
 #include "slap.h"
+#include "slapi.h"
 
 static char *v2ref( BerVarray ref, const char *text )
 {
@@ -370,6 +371,12 @@ send_ldap_response(
                return;
        }
 
+#ifdef LDAP_SLAPI
+       slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)err );
+       slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, ( matched != NULL ) ? (void *)ch_strdup( matched ) : NULL );
+       slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, ( text != NULL ) ? (void *)ch_strdup( text ) : NULL );
+#endif /* LDAP_SLAPI */
+
        ldap_pvt_thread_mutex_lock( &num_sent_mutex );
        num_bytes_sent += bytes;
        num_pdu_sent++;
index 151505f708edfa5d3393b21030908e32c7467bda..d72b6397e6c6b2470a19e0a959b996b7b8b00dbb 100644 (file)
@@ -340,9 +340,9 @@ do_search(
        suffix_alias( be, &nbase );
 
 #if defined( LDAP_SLAPI )
-       slapi_backend_set_pb( pb, be );
-       slapi_connection_set_pb( pb, conn );
-       slapi_operation_set_pb( pb, op );
+       slapi_x_backend_set_pb( pb, be );
+       slapi_x_connection_set_pb( pb, conn );
+       slapi_x_operation_set_pb( pb, op );
        slapi_pblock_set( pb, SLAPI_SEARCH_TARGET, (void *)base.bv_val );
        slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, (void *)scope );
        slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, (void *)deref );
index ad8ecec046438158292926d533d9e0363a27c13a..e219e87182e15356507c0ae5a3a8af81a08bc9ea 100644 (file)
@@ -37,7 +37,8 @@ LDAP_END_DECL
 LDAP_BEGIN_DECL
 
 /*
- * types of plugins
+ * Plugin types universally supported by SLAPI
+ * implementations
  */
 #define SLAPI_PLUGIN_DATABASE           1
 #define SLAPI_PLUGIN_EXTENDEDOP         2
@@ -45,7 +46,21 @@ LDAP_BEGIN_DECL
 #define SLAPI_PLUGIN_POSTOPERATION      4
 #define SLAPI_PLUGIN_MATCHINGRULE       5
 #define SLAPI_PLUGIN_SYNTAX             6
+/* XXX this is SLAPI_PLUGIN_ACL in SunDS */
 #define SLAPI_PLUGIN_AUDIT              7
+/*
+ * The following plugin types are reserved for future
+ * Sun ONE DS compatability.
+ */
+#define SLAPI_PLUGIN_BEPREOPERATION             8       
+#define SLAPI_PLUGIN_BEPOSTOPERATION            9       
+#define SLAPI_PLUGIN_ENTRY                      10      
+#define SLAPI_PLUGIN_TYPE_OBJECT                11      
+#define SLAPI_PLUGIN_INTERNAL_PREOPERATION      12      
+#define SLAPI_PLUGIN_INTERNAL_POSTOPERATION     13
+#define SLAPI_PLUGIN_PWD_STORAGE_SCHEME         14
+#define SLAPI_PLUGIN_VATTR_SP                   15
+#define SLAPI_PLUGIN_REVER_PWD_STORAGE_SCHEME   16
 
 #define SLAPI_PLUGIN_EXTENDED_SENT_RESULT       -1
 #define SLAPI_PLUGIN_EXTENDED_NOT_HANDLED       -2
index e9b7521522a5ac7cb65187974619f9b4c46650e8..fdc5c85a2923f82dce2b03c6b820ffdd87b5eb30 100644 (file)
@@ -703,10 +703,6 @@ 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) */
 }
@@ -1135,7 +1131,7 @@ slapi_free_search_results_internal( Slapi_PBlock *pb )
 /*
  * Internal API to prime a Slapi_PBlock with a Backend.
  */
-int slapi_backend_set_pb( Slapi_PBlock *pb, Backend *be )
+int slapi_x_backend_set_pb( Slapi_PBlock *pb, Backend *be )
 {
 #if defined(LDAP_SLAPI)
        int rc;
@@ -1157,7 +1153,7 @@ int slapi_backend_set_pb( Slapi_PBlock *pb, Backend *be )
 /*
  * Internal API to prime a Slapi_PBlock with a Connection.
  */
-int slapi_connection_set_pb( Slapi_PBlock *pb, Connection *conn )
+int slapi_x_connection_set_pb( Slapi_PBlock *pb, Connection *conn )
 {
 #if defined(LDAP_SLAPI)
        char *connAuthType;
@@ -1211,7 +1207,7 @@ int slapi_connection_set_pb( Slapi_PBlock *pb, Connection *conn )
 /*
  * Internal API to prime a Slapi_PBlock with an Operation.
  */
-int slapi_operation_set_pb( Slapi_PBlock *pb, Operation *op )
+int slapi_x_operation_set_pb( Slapi_PBlock *pb, Operation *op )
 {
 #if defined(LDAP_SLAPI)
        int isRoot = 0;
index e231539aec763c8ae41c87c8a1611082d637761d..6adcd18845b970cf8888e93afc3f3b45b595f986 100644 (file)
@@ -110,9 +110,9 @@ int slapi_audit_init_header( Connection *conn, Operation *op,
 int slapi_audit_send_record( Slapi_PBlock *pb, Connection *conn, 
                                                Operation *op, int rc);
 
-int slapi_backend_set_pb( Slapi_PBlock *pb, Backend *be );
-int slapi_connection_set_pb( Slapi_PBlock *pb, Connection *conn );
-int slapi_operation_set_pb( Slapi_PBlock *pb, Operation *op );
+int slapi_x_backend_set_pb( Slapi_PBlock *pb, Backend *be );
+int slapi_x_connection_set_pb( Slapi_PBlock *pb, Connection *conn );
+int slapi_x_operation_set_pb( Slapi_PBlock *pb, Operation *op );
 
 extern ldap_pvt_thread_mutex_t slapi_hn_mutex;
 extern ldap_pvt_thread_mutex_t slapi_time_mutex;