cleanup (related to ITS#5760)

This commit is contained in:
Pierangelo Masarati 2009-02-15 22:16:21 +00:00
parent 040f945d36
commit d36099aa62
8 changed files with 20 additions and 23 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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
*/

View file

@ -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 );

View file

@ -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<fattr_cnt; i++ ) {

View file

@ -321,7 +321,7 @@ rwm_map_attrnames(
if ( j == 0 && i != 0 ) {
memset( &(*anp)[0], 0, sizeof( AttributeName ) );
BER_BVSTR( &(*anp)[0].an_name, LDAP_NO_ATTRS );
(*anp)[0].an_name = *slap_bv_no_attrs;
j = 1;
}
memset( &(*anp)[j], 0, sizeof( AttributeName ) );

View file

@ -195,6 +195,11 @@ LDAP_SLAPD_V( struct berval * ) slap_bv_no_attrs;
LDAP_SLAPD_V( struct berval * ) slap_bv_all_user_attrs;
LDAP_SLAPD_V( struct berval * ) slap_bv_all_operational_attrs;
/* deprecated; only defined for backward compatibility */
#define NoAttrs (*slap_bv_no_attrs)
#define AllUser (*slap_bv_all_user_attrs)
#define AllOper (*slap_bv_all_operational_attrs)
/*
* add.c
*/
@ -1958,10 +1963,6 @@ LDAP_SLAPD_V (ber_socket_t) dtblsize;
LDAP_SLAPD_V (int) use_reverse_lookup;
LDAP_SLAPD_V (struct berval) AllUser;
LDAP_SLAPD_V (struct berval) AllOper;
LDAP_SLAPD_V (struct berval) NoAttrs;
/*
* operations
*/

View file

@ -1656,9 +1656,9 @@ slap_attr_flags( AttributeName *an )
flags |= ( SLAP_OPATTRS_NO | SLAP_USERATTRS_YES );
} else {
flags |= an_find( an, &AllOper )
flags |= an_find( an, slap_bv_all_operational_attrs )
? SLAP_OPATTRS_YES : SLAP_OPATTRS_NO;
flags |= an_find( an, &AllUser )
flags |= an_find( an, slap_bv_all_user_attrs )
? SLAP_USERATTRS_YES : SLAP_USERATTRS_NO;
}