From 2a8dec95ba9a91e2c4f3e5b48f789eb803363650 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 25 Feb 2003 21:19:42 +0000 Subject: [PATCH] SLAP_NVALUES back-monitor temporary hack --- servers/slapd/back-monitor/backend.c | 6 +++--- servers/slapd/back-monitor/conn.c | 6 +++--- servers/slapd/back-monitor/database.c | 12 ++++++------ servers/slapd/back-monitor/init.c | 2 +- servers/slapd/back-monitor/listener.c | 4 ++-- servers/slapd/back-monitor/log.c | 10 +++++----- servers/slapd/back-monitor/operation.c | 8 ++++---- servers/slapd/back-monitor/rww.c | 2 +- servers/slapd/back-monitor/sent.c | 8 ++++---- servers/slapd/back-monitor/thread.c | 4 ++-- servers/slapd/proto-slap.h | 5 +++++ 11 files changed, 36 insertions(+), 31 deletions(-) diff --git a/servers/slapd/back-monitor/backend.c b/servers/slapd/back-monitor/backend.c index 91a7802a9f..e19d1d6e80 100644 --- a/servers/slapd/back-monitor/backend.c +++ b/servers/slapd/back-monitor/backend.c @@ -110,8 +110,8 @@ monitor_subsys_backend_init( bv[0].bv_len = strlen( bv[0].bv_val ); bv[1].bv_val = NULL; - attr_merge( e, monitor_ad_desc, bv ); - attr_merge( e_backend, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); + attr_mergeit( e_backend, monitor_ad_desc, bv ); if ( bi->bi_controls ) { int j; @@ -119,7 +119,7 @@ monitor_subsys_backend_init( for ( j = 0; bi->bi_controls[ j ]; j++ ) { bv[0].bv_val = bi->bi_controls[ j ]; bv[0].bv_len = strlen( bv[0].bv_val ); - attr_merge( e, slap_schema.si_ad_supportedControl, bv ); + attr_mergeit( e, slap_schema.si_ad_supportedControl, bv ); } } diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 937b44d2f6..3b75a1b94a 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -105,7 +105,7 @@ monitor_subsys_conn_init( bv[1].bv_val = NULL; bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -163,7 +163,7 @@ monitor_subsys_conn_init( bv[1].bv_val = NULL; bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -336,7 +336,7 @@ conn_create( bv[1].bv_val = NULL; bv[0].bv_val = buf; bv[0].bv_len = strlen( buf ); - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 9620419652..0a2ee4b13d 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -136,11 +136,11 @@ monitor_subsys_database_init( } if ( be->be_flags & SLAP_BFLAG_MONITOR ) { - attr_merge( e, ad_mc, be->be_suffix ); - attr_merge( e_database, ad_mc, be->be_suffix ); + attr_mergeit( e, ad_mc, be->be_suffix ); + attr_mergeit( e_database, ad_mc, be->be_suffix ); } else { - attr_merge( e, ad_nc, be->be_suffix ); - attr_merge( e_database, ad_nc, be->be_suffix ); + attr_mergeit( e, ad_nc, be->be_suffix ); + attr_mergeit( e_database, ad_nc, be->be_suffix ); } for ( j = nBackendInfo; j--; ) { @@ -152,7 +152,7 @@ monitor_subsys_database_init( j, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val ); bv.bv_val = buf; bv.bv_len = strlen( buf ); - attr_merge_one( e, ad_seeAlso, &bv ); + attr_mergeit_one( e, ad_seeAlso, &bv ); break; } } @@ -239,7 +239,7 @@ monitor_back_add_plugin( Backend *be, Entry *e_database ) bv.bv_val = buf; bv.bv_len = strlen( buf ); - attr_merge_one( e_database, monitor_ad_desc, &bv ); + attr_mergeit_one( e_database, monitor_ad_desc, &bv ); i++; diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index ed754ce396..4c68e7491b 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -427,7 +427,7 @@ monitor_back_db_init( } else { bv[0].bv_len = strlen( Versionstr ); } - if ( attr_merge( e, monitor_ad_desc, bv ) ) { + if ( attr_mergeit( e, monitor_ad_desc, bv ) ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, CRIT, "unable to add description to '%s' entry\n", diff --git a/servers/slapd/back-monitor/listener.c b/servers/slapd/back-monitor/listener.c index 71879643f7..c66e1c5f2f 100644 --- a/servers/slapd/back-monitor/listener.c +++ b/servers/slapd/back-monitor/listener.c @@ -126,7 +126,7 @@ monitor_subsys_listener_init( bv[1].bv_val = NULL; bv[0].bv_val = "TLS"; bv[0].bv_len = sizeof("TLS")-1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); } #endif /* HAVE_TLS */ #ifdef LDAP_CONNECTIONLESS @@ -135,7 +135,7 @@ monitor_subsys_listener_init( bv[1].bv_val = NULL; bv[0].bv_val = "UDP"; bv[0].bv_len = sizeof("UDP")-1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); } #endif /* HAVE_TLS */ diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index b15053ae25..121820dc09 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -117,7 +117,7 @@ monitor_subsys_log_init( bv[0].bv_val = ( char * )int_2_level[ i ].s; bv[0].bv_len = strlen( bv[0].bv_val ); - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); } } @@ -151,7 +151,7 @@ monitor_subsys_log_modify( */ if ( is_at_operational( mod->sm_desc->ad_type ) ) { ( void ) attr_delete( &e->e_attrs, mod->sm_desc ); - rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues ); + rc = attr_mergeit( e, mod->sm_desc, mod->sm_bvalues ); if ( rc != 0 ) { rc = LDAP_OTHER; break; @@ -347,8 +347,8 @@ add_values( Entry *e, Modification *mod, int *newlevel ) } /* no - add them */ - if ( attr_merge( e, mod->sm_desc, mod->sm_bvalues ) != 0 ) { - /* this should return result of attr_merge */ + if ( attr_mergeit( e, mod->sm_desc, mod->sm_bvalues ) != 0 ) { + /* this should return result of attr_mergeit */ return LDAP_OTHER; } @@ -471,7 +471,7 @@ replace_values( Entry *e, Modification *mod, int *newlevel ) } if ( mod->sm_bvalues != NULL && - attr_merge( e, mod->sm_desc, mod->sm_bvalues ) != 0 ) { + attr_mergeit( e, mod->sm_desc, mod->sm_bvalues ) != 0 ) { return LDAP_OTHER; } diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index 71ce6cb07e..5ce6d1db26 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -124,7 +124,7 @@ monitor_subsys_ops_init( bv[1].bv_val = NULL; bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -192,7 +192,7 @@ monitor_subsys_ops_init( bv[1].bv_val = NULL; bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -259,7 +259,7 @@ monitor_subsys_ops_init( bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -326,7 +326,7 @@ monitor_subsys_ops_init( bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index 904a81afae..c68dfab365 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -119,7 +119,7 @@ monitor_subsys_readw_update_internal( if ( b == NULL || b[0].bv_val == NULL ) { bv[0].bv_val = buf; bv[0].bv_len = strlen( buf ); - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); } return( 0 ); diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index 99bd329a78..137e8efb8c 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -102,7 +102,7 @@ monitor_subsys_sent_init( bv[1].bv_val = NULL; bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -158,7 +158,7 @@ monitor_subsys_sent_init( bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -214,7 +214,7 @@ monitor_subsys_sent_init( bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; @@ -270,7 +270,7 @@ monitor_subsys_sent_init( bv[0].bv_val = "0"; bv[0].bv_len = 1; - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; diff --git a/servers/slapd/back-monitor/thread.c b/servers/slapd/back-monitor/thread.c index 85331e597d..36d7d6132f 100644 --- a/servers/slapd/back-monitor/thread.c +++ b/servers/slapd/back-monitor/thread.c @@ -76,7 +76,7 @@ monitor_subsys_thread_init( bv[0].bv_val = buf; bv[0].bv_len = strlen( bv[0].bv_val ); - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); monitor_cache_release( mi, e ); @@ -113,7 +113,7 @@ monitor_subsys_thread_update( if ( b == NULL || b[0].bv_val == NULL ) { bv[0].bv_val = buf; bv[0].bv_len = strlen( buf ); - attr_merge( e, monitor_ad_desc, bv ); + attr_mergeit( e, monitor_ad_desc, bv ); } return( 0 ); diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 98ed4e6c46..c85866f60c 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -133,6 +133,9 @@ LDAP_SLAPD_F (void) attr_free LDAP_P(( Attribute *a )); LDAP_SLAPD_F (Attribute *) attr_dup LDAP_P(( Attribute *a )); #ifdef SLAP_NVALUES +#define attr_mergeit( e, d, v ) attr_merge( e, d, v, NULL /* FIXME */ ) +#define attr_mergeit_one( e, d, v ) attr_merge_one( e, d, v, NULL /* FIXME */ ) + LDAP_SLAPD_F (int) attr_merge LDAP_P(( Entry *e, AttributeDescription *desc, BerVarray vals, @@ -142,6 +145,8 @@ LDAP_SLAPD_F (int) attr_merge_one LDAP_P(( Entry *e, struct berval *val, struct berval *nval )); #else +#define attr_mergeit( e, d, v ) attr_merge( e, d, v ) +#define attr_mergeit_one( e, d, v ) attr_merge( e, d, v ) LDAP_SLAPD_F (int) attr_merge LDAP_P(( Entry *e, AttributeDescription *desc, BerVarray vals )); -- 2.39.5