/* has language tag */
bdb_attr_mask( be->be_private, desc->ad_type->sat_ad, &mask );
- if (! ( mask & SLAP_INDEX_NOLANG ) ) {
+ if ( mask && ( mask ^ SLAP_INDEX_NOLANG ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = desc->ad_type->sat_cname.bv_val;
return mask;
bdb_attr_mask( be->be_private, at->sat_ad, &mask );
- if( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
+ if ( mask && ( mask ^ SLAP_INDEX_NOSUBTYPES ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = at->sat_cname.bv_val;
return mask;
}
-
- if( !( mask & SLAP_INDEX_NOSUBTYPES ) ) {
- *atname = at->sat_cname;
- *dbname = at->sat_cname.bv_val;
- return mask;
- }
-
- if( mask ) break;
}
return 0;
if( mask ) {
*dbnamep = type->sat_cname.bv_val;
- } else if ( !( tmpmask & SLAP_INDEX_AUTO_SUBTYPES ) ) {
+ } else if ( tmpmask ^ SLAP_INDEX_NOSUBTYPES ) {
mask = tmpmask;
}
mask );
if( rc ) return rc;
+ *maskp = mask;
}
if( lang->bv_len ) {
/* has language tag */
attr_mask( be->be_private, desc->ad_type->sat_ad, &mask );
- if( !( mask & SLAP_INDEX_NOLANG ) ) {
+ if( mask && ( mask ^ SLAP_INDEX_NOLANG ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = desc->ad_type->sat_cname.bv_val;
return mask;
}
/* see if supertype defined mask for its subtypes */
- for( at = desc->ad_type; at != NULL ; at = at->sat_sup ) {
+ for( at = desc->ad_type->sat_sup; at != NULL ; at = at->sat_sup ) {
/* If no AD, we've never indexed this type */
if (!at->sat_ad)
continue;
attr_mask( be->be_private, at->sat_ad, &mask );
- if( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
+ if( mask && ( mask ^ SLAP_INDEX_NOSUBTYPES ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = at->sat_cname.bv_val;
return mask;
}
- if( !( mask & SLAP_INDEX_NOSUBTYPES ) ) {
- *atname = at->sat_cname;
- *dbname = at->sat_cname.bv_val;
- return mask;
- }
-
- if( mask ) break;
}
return 0;
if( mask ) {
*dbnamep = type->sat_cname.bv_val;
- } else if ( tmpmask & SLAP_INDEX_AUTO_SUBTYPES ) {
+ } else if ( tmpmask ^ SLAP_INDEX_NOSUBTYPES ) {
mask = tmpmask;
}
&type->sat_cname,
vals, id, op,
mask );
+ *maskp = mask;
}
if( lang->bv_len ) {
*idx = SLAP_INDEX_NOLANG;
} else if ( strcasecmp( str, "nosubtypes" ) == 0 ) {
*idx = SLAP_INDEX_NOSUBTYPES;
- } else if ( strcasecmp( str, "autosubtypes" ) == 0 ) {
- *idx = SLAP_INDEX_AUTO_SUBTYPES;
} else {
return LDAP_OTHER;
}
#define SLAP_INDEX_FLAGS 0xF000UL
#define SLAP_INDEX_NOSUBTYPES 0x1000UL /* don't use index w/ subtypes */
#define SLAP_INDEX_NOLANG 0x2000UL /* don't use index w/ lang */
-#define SLAP_INDEX_AUTO_SUBTYPES 0x4000UL /* use mask with lang subtypes */
/*
* there is a single index for each attribute. these prefixes ensure