/* has language tag */
attr_mask( be->be_private, desc->ad_type->sat_ad, &mask );
- if( mask & SLAP_INDEX_AUTO_LANG ) {
- *atname = desc->ad_cname;
- *dbname = desc->ad_type->sat_cname.bv_val;
- return mask;
- }
- if( mask & SLAP_INDEX_LANG ) {
+ if( !( mask & SLAP_INDEX_NOLANG ) ) {
*atname = desc->ad_type->sat_cname;
*dbname = desc->ad_type->sat_cname.bv_val;
return mask;
*dbname = at->sat_cname.bv_val;
return mask;
}
- if( mask & SLAP_INDEX_SUBTYPES ) {
+ if( !( mask & SLAP_INDEX_NOSUBTYPES ) ) {
*atname = at->sat_cname;
*dbname = at->sat_cname.bv_val;
return mask;
return LDAP_INAPPROPRIATE_MATCHING;
}
- switch(ftype) {
+ switch( ftype ) {
case LDAP_FILTER_PRESENT:
if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
goto done;
{
slap_mask_t mask = 0;
slap_mask_t tmpmask = 0;
- int lindex = 0;
if( type->sat_sup ) {
/* recurse */
}
/* If this type has no AD, we've never used it before */
- if (type->sat_ad)
+ if( type->sat_ad ) {
attr_mask( be->be_private, type->sat_ad, &mask );
+ }
if( mask ) {
*dbnamep = type->sat_cname.bv_val;
lname.bv_val = NULL;
desc = ad_find_lang(type, lang);
- if (desc)
+ if( desc ) {
attr_mask( be->be_private, desc, &tmpmask );
+ }
if( tmpmask ) {
dbname = desc->ad_cname.bv_val;
lname = desc->ad_cname;
mask = tmpmask;
- } else if ( mask & SLAP_INDEX_AUTO_LANG ) {
- dbname = *dbnamep;
- lname.bv_len = type->sat_cname.bv_len+lang->bv_len + 1;
- lname.bv_val = ch_malloc( lname.bv_len + 1 );
-
- strcpy(lname.bv_val, type->sat_cname.bv_val);
- lname.bv_val[type->sat_cname.bv_len] = ';';
- strcpy(lname.bv_val+type->sat_cname.bv_len+1,
- lang->bv_val);
}
if( dbname != NULL ) {
indexer( be, dbname, &lname,
vals, id, op,
mask );
- if (!tmpmask)
+ if( !tmpmask ) {
ch_free( lname.bv_val );
+ }
}
}
return LDAP_SUCCESS;
}
-
int
index_entry(
Backend *be,
int op,
- Entry *e,
- Attribute *ap
-)
+ Entry *e,
+ Attribute *ap )
{
#ifdef NEW_LOGGING
LDAP_LOG(( "index", LDAP_LEVEL_ENTRY,
e->e_id, e->e_dn );
#endif
-
/* add each attribute to the indexes */
for ( ; ap != NULL; ap = ap->a_next ) {
index_values( be, ap->a_desc, ap->a_vals, e->e_id, op );
e->e_id, e->e_dn );
#endif
-
return LDAP_SUCCESS;
}