From d36099aa6254d6856524a66f7b57e07bd529ce69 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 15 Feb 2009 22:16:21 +0000 Subject: [PATCH] cleanup (related to ITS#5760) --- servers/slapd/back-sql/entry-id.c | 2 +- servers/slapd/back-sql/search.c | 10 +++++----- servers/slapd/init.c | 4 ---- servers/slapd/overlays/dynlist.c | 8 ++++---- servers/slapd/overlays/pcache.c | 4 ++-- servers/slapd/overlays/rwmmap.c | 2 +- servers/slapd/proto-slap.h | 9 +++++---- servers/slapd/result.c | 4 ++-- 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/servers/slapd/back-sql/entry-id.c b/servers/slapd/back-sql/entry-id.c index 5ad9eb874b..e1351b9967 100644 --- a/servers/slapd/back-sql/entry-id.c +++ b/servers/slapd/back-sql/entry-id.c @@ -1042,7 +1042,7 @@ next:; } if ( ( bsi->bsi_flags & BSQL_SF_ALL_OPER ) - || an_find( bsi->bsi_attrs, &AllOper ) + || an_find( bsi->bsi_attrs, slap_bv_all_operational_attrs ) || an_find( bsi->bsi_attrs, &slap_schema.si_ad_structuralObjectClass->ad_cname ) ) { ObjectClass *soc = NULL; diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 1f8cbb3f6d..a65ffcf027 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -184,7 +184,7 @@ backsql_init_search( BER_BVZERO( &bsi->bsi_attrs[ 0 ].an_name ); for ( p = attrs; !BER_BVISNULL( &p->an_name ); p++ ) { - if ( BACKSQL_NCMP( &p->an_name, &AllUser ) == 0 ) { + if ( BACKSQL_NCMP( &p->an_name, slap_bv_all_user_attrs ) == 0 ) { /* handle "*" */ bsi->bsi_flags |= BSQL_SF_ALL_USER; @@ -198,7 +198,7 @@ backsql_init_search( } continue; - } else if ( BACKSQL_NCMP( &p->an_name, &AllOper ) == 0 ) { + } else if ( BACKSQL_NCMP( &p->an_name, slap_bv_all_operational_attrs ) == 0 ) { /* handle "+" */ bsi->bsi_flags |= BSQL_SF_ALL_OPER; @@ -212,7 +212,7 @@ backsql_init_search( } continue; - } else if ( BACKSQL_NCMP( &p->an_name, &NoAttrs ) == 0 ) { + } else if ( BACKSQL_NCMP( &p->an_name, slap_bv_no_attrs ) == 0 ) { /* ignore "1.1" */ continue; @@ -237,7 +237,7 @@ backsql_init_search( /* use hints if available */ for ( p = bi->sql_anlist; !BER_BVISNULL( &p->an_name ); p++ ) { - if ( BACKSQL_NCMP( &p->an_name, &AllUser ) == 0 ) { + if ( BACKSQL_NCMP( &p->an_name, slap_bv_all_user_attrs ) == 0 ) { /* handle "*" */ bsi->bsi_flags |= BSQL_SF_ALL_USER; @@ -251,7 +251,7 @@ backsql_init_search( } continue; - } else if ( BACKSQL_NCMP( &p->an_name, &AllOper ) == 0 ) { + } else if ( BACKSQL_NCMP( &p->an_name, slap_bv_all_operational_attrs ) == 0 ) { /* handle "+" */ bsi->bsi_flags |= BSQL_SF_ALL_OPER; diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 27734d4bd9..ae15d0515a 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -55,10 +55,6 @@ int ldap_syslog_level = LOG_DEBUG; BerVarray default_referral = NULL; -struct berval AllUser = BER_BVC( LDAP_ALL_USER_ATTRIBUTES ); -struct berval AllOper = BER_BVC( LDAP_ALL_OPERATIONAL_ATTRIBUTES ); -struct berval NoAttrs = BER_BVC( LDAP_NO_ATTRS ); - /* * global variables that need mutex protection */ diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 1210b6582a..736e641a47 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -266,8 +266,8 @@ dynlist_sc_update( Operation *op, SlapReply *rs ) } #ifndef SLAP_OPATTRS - opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, &AllOper ); - userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, &AllUser ); + opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, slap_bv_operational_attrs ); + userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, slap_bv_user_attrs ); #else /* SLAP_OPATTRS */ opattrs = SLAP_OPATTRS( rs->sr_attr_flags ); userattrs = SLAP_USERATTRS( rs->sr_attr_flags ); @@ -416,8 +416,8 @@ dynlist_prepare_entry( Operation *op, SlapReply *rs, dynlist_info_t *dli ) } #ifndef SLAP_OPATTRS - opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, &AllOper ); - userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, &AllUser ); + opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, slap_bv_operational_attrs ); + userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, slap_bv_user_attrs ); #else /* SLAP_OPATTRS */ opattrs = SLAP_OPATTRS( rs->sr_attr_flags ); userattrs = SLAP_USERATTRS( rs->sr_attr_flags ); diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 49d4d9c1ca..b0b7c65c1c 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2168,8 +2168,8 @@ add_filter_attrs( (*new_attrs)[i].an_desc = attrs->attrs[i].an_desc; } BER_BVZERO( &(*new_attrs)[i].an_name ); - alluser = an_find(*new_attrs, &AllUser); - allop = an_find(*new_attrs, &AllOper); + alluser = an_find( *new_attrs, slap_bv_all_user_attrs ); + allop = an_find( *new_attrs, slap_bv_all_operational_attrs ); j = i; for ( i=0; i