From f83585952d10d015ac82bd29712cc61872dc5462 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 27 Dec 2002 11:48:41 +0000 Subject: [PATCH] misc slapi cleanup --- servers/slapd/Makefile.in | 13 ++-- servers/slapd/back-monitor/database.c | 1 + servers/slapd/slapi/ibm_pblock_params.h | 2 +- servers/slapd/slapi/printmsg.c | 2 +- servers/slapd/slapi/slapi.h | 2 + servers/slapd/slapi/slapi_common.h | 3 +- servers/slapd/slapi/slapi_ops.c | 96 +++++++++++++------------ servers/slapd/slapi/slapi_ops.h | 26 ++++--- servers/slapd/slapi/slapi_utils.h | 16 ++--- 9 files changed, 89 insertions(+), 72 deletions(-) diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in index 7f225c2cee..fd6d5e5d75 100644 --- a/servers/slapd/Makefile.in +++ b/servers/slapd/Makefile.in @@ -39,9 +39,10 @@ LDAP_INCDIR= ../../include -Islapi LDAP_LIBDIR= ../../libraries SLAP_DIR= -SLAPD_STATIC_DEPENDS=@SLAPD_SLAPI_DEPEND@ @SLAPD_NO_STATIC@ libbackends.a +SLAPD_STATIC_DEPENDS=@SLAPD_NO_STATIC@ libbackends.a SLAPD_STATIC_BACKENDS=@SLAPD_STATIC_BACKENDS@ SLAPD_DYNAMIC_BACKENDS=@SLAPD_DYNAMIC_BACKENDS@ +SLAPD_SLAPI_DEPEND=@SLAPD_SLAPI_DEPEND@ XDEFS = $(MODULES_CPPFLAGS) XLDFLAGS = $(MODULES_LDFLAGS) @@ -224,13 +225,13 @@ slapd.exp: libslapd.a dlltool --dllname slapd.exe --input-def slapd.def \ --base-file slapd.base --output-exp $@ -.slapi: FORCE - $(AR) ruv slapi/libtmpslapd.a $(OBJS) - (cd slapi; $(MAKE) $(MFLAGS) all) - libslapi.a: .slapi cp slapi/.libs/libslapi.a . +.slapi: slapd + $(AR) ruv slapi/libtmpslapd.a $(OBJS) + (cd slapi; $(MAKE) $(MFLAGS) all) + slapd: $(SLAPD_DEPENDS) $(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \ $(WRAP_LIBS) @@ -238,7 +239,7 @@ slapd: $(SLAPD_DEPENDS) sslapd: version.o $(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS) -tools $(SLAPD_DYNAMIC_BACKENDS): slapd +tools $(SLAPD_DYNAMIC_BACKENDS) $(SLAPD_SLAPI_DEPEND): slapd cd $@; $(MAKE) $(MFLAGS) all @touch $@ diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 41dea0f1c8..634988a68a 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -37,6 +37,7 @@ #include "slap.h" #include "slapi-plugin.h" +#include "slapi_pblock.h" #include "back-monitor.h" #if defined(LDAP_SLAPI) diff --git a/servers/slapd/slapi/ibm_pblock_params.h b/servers/slapd/slapi/ibm_pblock_params.h index 13be5fda86..4a3902d32e 100644 --- a/servers/slapd/slapi/ibm_pblock_params.h +++ b/servers/slapd/slapi/ibm_pblock_params.h @@ -65,4 +65,4 @@ #define SLAPI_IBM_EVENT_SENTREG (FIRST_PARAM - 45) #define SLAPI_IBM_CONN_DN_ORIG (FIRST_PARAM - 46) #define SLAPI_PLUGIN_DB_DELETE_PROGRESS_FN (FIRST_PARAM - 47) -#endif +#endif /* _ibm_pblock_params_H */ diff --git a/servers/slapd/slapi/printmsg.c b/servers/slapd/slapi/printmsg.c index 87ff17ed40..086032b6b4 100644 --- a/servers/slapd/slapi/printmsg.c +++ b/servers/slapd/slapi/printmsg.c @@ -27,7 +27,7 @@ /* Single threads access to routine */ ldap_pvt_thread_mutex_t slapi_printmessage_mutex; -const char *slapi_log_file = NULL; +char *slapi_log_file = NULL; int slapi_log_level = SLAPI_LOG_PLUGIN; int diff --git a/servers/slapd/slapi/slapi.h b/servers/slapd/slapi/slapi.h index e46f6c4afb..cfb212cbab 100644 --- a/servers/slapd/slapi/slapi.h +++ b/servers/slapd/slapi/slapi.h @@ -26,7 +26,9 @@ typedef Filter Slapi_Filter; #endif /* NO_PBLOCK_CLASS */ #include #include +#if 0 /* unused (yet?) */ #include +#endif /* 0 */ /* * types of plugins diff --git a/servers/slapd/slapi/slapi_common.h b/servers/slapd/slapi/slapi_common.h index 7a97d5d403..0ff7a99519 100644 --- a/servers/slapd/slapi/slapi_common.h +++ b/servers/slapd/slapi/slapi_common.h @@ -28,8 +28,7 @@ extern int slap_debug; int -dn_check(char *, int *); - +dn_check(char *, int *); typedef struct strlist { char *string; diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 4ff9264c42..b664fd1dfd 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -20,27 +20,28 @@ int bvptr2obj( struct berval **bvptr, struct berval **bvobj ); -int +static void internal_result_v3( - Connection *conn, - Operation *op, - int err, - char *matched, - char *text, - char **referrals ) + Connection *conn, + Operation *op, + ber_int_t err, + const char *matched, + const char *text, + BerVarray referrals, + LDAPControl **ctrls ) { - return LDAP_SUCCESS; + return; } -int +static int internal_search_entry( - Backend *be, - Connection *conn, - Operation *op, - Entry *e, - char **attrs, - int attrsonly, - char **denied_attrs ) + Backend *be, + Connection *conn, + Operation *op, + Entry *e, + AttributeName *attrs, + int attrsonly, + LDAPControl **ctrls ) { char *ent2str = NULL; int nentries = 0, len = 0, i = 0; @@ -90,37 +91,47 @@ internal_search_entry( return LDAP_SUCCESS; } -int +static void internal_search_result( - Connection *conn, - Operation *op, - int err, - char *matched, - char *text, - int nentries ) + Connection *conn, + Operation *op, + ber_int_t err, + const char *matched, + const char *text, + BerVarray refs, + LDAPControl **ctrls, + int nentries ) { slapi_pblock_set( (Slapi_PBlock *)op->o_pb, SLAPI_NENTRIES, (void *)nentries ); - return LDAP_SUCCESS; + return; } -int +static void internal_result_ext( - Connection *conn, - Operation *op, - int errnum, - char *respname, - struct berval *response ) + Connection *conn, + Operation *op, + ber_int_t errnum, + const char *matched, + const char *text, + BerVarray refs, + const char *rspoid, + struct berval *rspdata, + LDAPControl **ctrls ) { - return LDAP_SUCCESS; + return; } -int +static int internal_search_reference( - Connection *conn, - Operation *op, - char **ref ) + Backend *be, + Connection *conn, + Operation *op, + Entry *e, + BerVarray refs, + LDAPControl **ctrls, + BerVarray *v2refs ) { return LDAP_SUCCESS; } @@ -220,16 +231,11 @@ fakeConnection( backend_connection_init( c ); - pConn->c_send_ldap_result = - (SEND_LDAP_RESULT) internal_result_v3; - pConn->c_send_search_entry = - (SEND_SEARCH_ENTRY) internal_search_entry; - pConn->c_send_search_result = - (SEND_SEARCH_RESULT) internal_search_result; - pConn->c_send_ldap_extended = - (SEND_LDAP_EXTENDED) internal_result_ext; - pConn->c_send_search_reference = - (SEND_SEARCH_REFERENCE) internal_search_reference; + pConn->c_send_ldap_result = internal_result_v3; + pConn->c_send_search_entry = internal_search_entry; + pConn->c_send_search_result = internal_search_result; + pConn->c_send_ldap_extended = internal_result_ext; + pConn->c_send_search_reference = internal_search_reference; return pConn; } diff --git a/servers/slapd/slapi/slapi_ops.h b/servers/slapd/slapi/slapi_ops.h index 26adf35aa8..41555a66ee 100644 --- a/servers/slapd/slapi/slapi_ops.h +++ b/servers/slapd/slapi/slapi_ops.h @@ -14,18 +14,26 @@ #define SLAPI_OPS_H Slapi_PBlock *slapi_search_internal( char *base, int scope, char *filter, - LDAPControl **controls, char **attrs, int attrsonly ); -Slapi_PBlock *slapi_search_internal_bind( char *bindDN, char *base, int scope, char *filter, - LDAPControl **controls, char **attrs, int attrsonly ); /* d58508 */ + LDAPControl **controls, char **attrs, int attrsonly ); +Slapi_PBlock *slapi_search_internal_bind( char *bindDN, char *base, + int scope, char *filter, LDAPControl **controls, + char **attrs, int attrsonly ); /* d58508 */ Slapi_PBlock *slapi_modify_internal( char *dn, LDAPMod **mods, LDAPControl **controls, int log_change ); -Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e, LDAPControl **controls, int log_change ); -Slapi_PBlock *slapi_add_internal( char * dn, LDAPMod **attrs, LDAPControl **controls, int log_changes ); -Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e, LDAPControl **controls, int log_change ); -Slapi_PBlock *slapi_delete_internal( char * dn, LDAPControl **controls, int log_change ); -Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn, int deloldrdn, LDAPControl **controls, int log_change); +Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e, + LDAPControl **controls, int log_change ); +Slapi_PBlock *slapi_add_internal( char * dn, LDAPMod **attrs, + LDAPControl **controls, int log_changes ); +Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e, + LDAPControl **controls, int log_change ); +Slapi_PBlock *slapi_delete_internal( char * dn, LDAPControl **controls, + int log_change ); +Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn, + int deloldrdn, LDAPControl **controls, int log_change); /* -Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn, char *newParent, int deloldrdn, LDAPControl **controls, int log_change); +Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn, + char *newParent, int deloldrdn, LDAPControl **controls, + int log_change); */ char **slapi_get_supported_extended_ops(void); int duplicateBVMod( LDAPMod *pMod, LDAPMod **ppNewMod ); diff --git a/servers/slapd/slapi/slapi_utils.h b/servers/slapd/slapi/slapi_utils.h index e8ee113562..49ae154275 100644 --- a/servers/slapd/slapi/slapi_utils.h +++ b/servers/slapd/slapi/slapi_utils.h @@ -28,16 +28,16 @@ typedef int (*SLAPI_FUNC)(Slapi_PBlock *pb); #define TCPIPPATH "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" typedef struct _slapi_control { - int s_ctrl_num; - char **s_ctrl_oids; - unsigned long *s_ctrl_ops; + int s_ctrl_num; + char **s_ctrl_oids; + unsigned long *s_ctrl_ops; } Slapi_Control; typedef struct _ExtendedOp { - struct berval ext_oid; - SLAPI_FUNC ext_func; - Backend *ext_be; - struct _ExtendedOp *ext_next; + struct berval ext_oid; + SLAPI_FUNC ext_func; + Backend *ext_be; + struct _ExtendedOp *ext_next; } ExtendedOp; int slapi_log_error( int severity, char *subsystem, char *fmt, ... ); @@ -111,7 +111,7 @@ int slapi_audit_send_record( Slapi_PBlock *pb, Connection *conn, extern ldap_pvt_thread_mutex_t slapi_hn_mutex; extern ldap_pvt_thread_mutex_t slapi_time_mutex; extern ldap_pvt_thread_mutex_t slapi_printmessage_mutex; -extern const char *slapi_log_file; +extern char *slapi_log_file; extern int slapi_log_level; #endif /* _SLAPI_UTILS_H */ -- 2.39.5