3 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 /* ava.c - routines for dealing with attribute value assertions */
12 #include <ac/string.h>
13 #include <ac/socket.h>
20 AttributeAssertion *ava,
24 free( ava->aa_value.bv_val );
26 ch_free( (char *) ava );
33 AttributeAssertion **ava,
40 struct berval type, value;
41 AttributeAssertion *aa;
43 rtag = ber_scanf( ber, "{mm}", &type, &value );
45 if( rtag == LBER_ERROR ) {
47 LDAP_LOG( FILTER, ERR, "get_ava: ber_scanf failure\n", 0, 0, 0 );
49 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
51 *text = "Error decoding attribute value assertion";
52 return SLAPD_DISCONNECT;
55 aa = ch_malloc( sizeof( AttributeAssertion ) );
57 aa->aa_value.bv_val = NULL;
59 rc = slap_bv2ad( &type, &aa->aa_desc, text );
61 if( rc != LDAP_SUCCESS ) {
67 rc = asserted_value_validate_normalize(
68 aa->aa_desc, ad_mr(aa->aa_desc, usage),
69 usage, &value, &aa->aa_value, text );
71 rc = value_validate_normalize( aa->aa_desc, usage,
72 &value, &aa->aa_value, text );
75 if( rc != LDAP_SUCCESS ) {