From: Luke Howard Date: Tue, 21 Jan 2003 02:46:55 +0000 (+0000) Subject: Mark Sun ONE 5.x SLAPI plugin types to avoid collisions X-Git-Tag: NO_SLAP_OP_BLOCKS~577 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8e8b4093f5172ff499e224b9d369cce830d802e6;p=openldap Mark Sun ONE 5.x SLAPI plugin types to avoid collisions 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 --- diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 0db53d78f4..9c55df9f79 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -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) ); diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index ee8b3809d3..7d3aea77e3 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -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++ ) { diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 9c9b9f8f9e..f444b9516d 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -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) ); diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index f50c58c380..c9b328060f 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -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 ); diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 012a1d71c2..a431c080dd 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -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) ); diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 481e22b962..c5ca7dca82 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -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; diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index cf06590296..5ff9b1d875 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -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 ); diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index d2f53ad977..ffa7410a36 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -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, diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 97abca094e..341040f8f4 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -17,6 +17,7 @@ #include #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++; diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 151505f708..d72b6397e6 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -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 ); diff --git a/servers/slapd/slapi/slapi.h b/servers/slapd/slapi/slapi.h index ad8ecec046..e219e87182 100644 --- a/servers/slapd/slapi/slapi.h +++ b/servers/slapd/slapi/slapi.h @@ -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 diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index e9b7521522..fdc5c85a29 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -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; diff --git a/servers/slapd/slapi/slapi_utils.h b/servers/slapd/slapi/slapi_utils.h index e231539aec..6adcd18845 100644 --- a/servers/slapd/slapi/slapi_utils.h +++ b/servers/slapd/slapi/slapi_utils.h @@ -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;