From f036fff9e567e5bb677793ffe89413afed9c985d Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 13 Nov 2004 14:57:39 +0000 Subject: [PATCH] further cleanup --- servers/slapd/back-monitor/back-monitor.h | 6 ++++++ servers/slapd/back-monitor/database.c | 2 +- servers/slapd/back-monitor/init.c | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index bc3a0842c1..e1e8bcad7d 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -29,6 +29,9 @@ LDAP_BEGIN_DECL +/* define if si_ad_labeledURI is removed from slap_schema */ +#undef MONITOR_DEFINE_LABELEDURI + typedef struct monitor_callback_t { int (*mc_update)( Operation *op, Entry *e, void *priv ); /* update callback @@ -106,7 +109,10 @@ typedef struct monitor_info_t { AttributeDescription *mi_ad_description; AttributeDescription *mi_ad_seeAlso; AttributeDescription *mi_ad_l; +#ifdef MONITOR_DEFINE_LABELEDURI + /* enable if si_ad_labeledURI is removed from slap_schema */ AttributeDescription *mi_ad_labeledURI; +#endif /* MONITOR_DEFINE_LABELEDURI */ AttributeDescription *mi_ad_readOnly; AttributeDescription *mi_ad_restrictedOperation; diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 46c4c2058e..785305ca17 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -252,7 +252,7 @@ monitor_subsys_database_init( bv.bv_val = li->url; bv.bv_len = strlen( bv.bv_val ); - attr_merge_normalize_one( e, mi->mi_ad_labeledURI, + attr_merge_normalize_one( e, slap_schema.si_ad_labeledURI, &bv, NULL ); } #endif /* defined(SLAPD_LDAP) */ diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 35be64d300..23d93e0c02 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -392,7 +392,7 @@ monitor_filter2ndn( struct berval *base, int scope, struct berval *filter, Operation op = { 0 }; SlapReply rs = { 0 }; slap_callback cb = { NULL, monitor_filter2ndn_cb, NULL, NULL }; - AttributeName anlist[ 2 ] = { { 0 }, { 0 } }; + AttributeName anlist[ 2 ]; int rc; BER_BVZERO( ndn ); @@ -431,6 +431,7 @@ monitor_filter2ndn( struct berval *base, int scope, struct berval *filter, op.ors_filter = str2filter_x( &op, filter->bv_val ); op.ors_attrs = anlist; BER_BVSTR( &anlist[ 0 ].an_name, LDAP_NO_ATTRS ); + BER_BVZERO( &anlist[ 1 ].an_name ); op.ors_attrsonly = 0; op.ors_tlimit = SLAP_NO_LIMIT; op.ors_slimit = 1; @@ -943,12 +944,14 @@ monitor_back_db_init( "DESC 'RFC2256: locality which this object resides in' " "SUP name )", 0, offsetof(monitor_info_t, mi_ad_l) }, +#ifdef MONITOR_DEFINE_LABELEDURI { "labeledURI", "( 1.3.6.1.4.1.250.1.57 " "NAME 'labeledURI' " "DESC 'RFC2079: Uniform Resource Identifier with optional label' " "EQUALITY caseExactMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", 0, offsetof(monitor_info_t, mi_ad_labeledURI) }, +#endif /* MONITOR_DEFINE_LABELEDURI */ { NULL, NULL, 0, -1 } }; -- 2.39.5