- f->f_avtype = strdup( str );
- f->f_avvalue.bv_val = strdup( value );
- f->f_avvalue.bv_len = strlen( value );
+ char *tmp;
+
+ f->f_ava = ch_calloc( 1, sizeof( AttributeAssertion ) );
+ f->f_av_desc = NULL;
+ rc = slap_str2ad( str, &f->f_av_desc, &text );
+ if( rc != LDAP_SUCCESS ) {
+ filter_free( f );
+ *(value-1) = '=';
+ return NULL;
+ }
+
+ tmp = ch_strdup( value );
+ ldap_pvt_filter_value_unescape( tmp );
+ f->f_av_value = ber_bvstr( tmp );