if( !slap_syntax_is_binary( desc.ad_type->sat_syntax )) {
/* not stored in binary, disallow option */
- *text = "option \"binary\" with type not supported";
+ *text = "option \"binary\" not supported with type";
return rtn;
}
d2 = ch_malloc(sizeof(AttributeDescription) + dlen + 1);
d2->ad_type = desc.ad_type;
d2->ad_flags = desc.ad_flags;
- d2->ad_cname.bv_len = desc.ad_cname.bv_len;
+ d2->ad_cname.bv_len = desc.ad_type->sat_cname.bv_len;
d2->ad_lang.bv_len = desc.ad_lang.bv_len;
if (dlen == 0) {
}
static int is_ad_sublang(
- const char *sublang,
- const char *suplang )
+ struct berval *sublangbv,
+ struct berval *suplangbv )
{
- const char *supp, *supdelimp;
- const char *subp, *subdelimp;
+ const char *suplang, *supp, *supdelimp;
+ const char *sublang, *subp, *subdelimp;
int suplen, sublen;
- if( suplang == NULL ) return 1;
- if( sublang == NULL ) return 0;
+ if( suplangbv->bv_len == 0 ) return 1;
+ if( sublangbv->bv_len == 0 ) return 0;
+
+ sublang =sublangbv->bv_val;
+ suplang =suplangbv->bv_val;
for( supp=suplang ; supp; supp=supdelimp ) {
supdelimp = strchrlen( supp, ';', &suplen );
}
/* check for language tags */
- if ( !is_ad_sublang( sub->ad_lang.bv_val, super->ad_lang.bv_val )) {
+ if ( !is_ad_sublang( &sub->ad_lang, &super->ad_lang )) {
return 0;
}
int i;
for ( i = 0; oc->soc_required[i] != NULL; i++ ) {
rc = is_at_subtype( desc->ad_type,
- oc->soc_allowed[i] );
+ oc->soc_required[i] );
if( rc ) return 1;
}
}
}
if( !desc ) {
- desc = ch_malloc(sizeof(AttributeDescription) +
- bv->bv_len + 1);
+ desc = ch_malloc(sizeof(AttributeDescription) + 1 +
+ bv->bv_len);
desc->ad_flags = SLAP_DESC_NONE;
desc->ad_lang.bv_val = NULL;