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>
21 AttributeAssertion *ava,
25 /* op->o_tmpfree( ava->aa_value.bv_val, op->o_tmpmemctx ); */
26 ch_free( ava->aa_value.bv_val );
28 op->o_tmpfree( (char *) ava, op->o_tmpmemctx );
36 AttributeAssertion **ava,
43 struct berval type, value;
44 AttributeAssertion *aa;
46 rtag = ber_scanf( ber, "{mm}", &type, &value );
48 if( rtag == LBER_ERROR ) {
50 LDAP_LOG( FILTER, ERR, "get_ava: ber_scanf failure\n", 0, 0, 0 );
52 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
54 *text = "Error decoding attribute value assertion";
55 return SLAPD_DISCONNECT;
58 aa = op->o_tmpalloc( sizeof( AttributeAssertion ), op->o_tmpmemctx );
60 aa->aa_value.bv_val = NULL;
62 rc = slap_bv2ad( &type, &aa->aa_desc, text );
64 if( rc != LDAP_SUCCESS ) {
65 op->o_tmpfree( aa, op->o_tmpmemctx );
69 rc = asserted_value_validate_normalize(
70 aa->aa_desc, ad_mr(aa->aa_desc, usage),
71 usage, &value, &aa->aa_value, text );
73 if( rc != LDAP_SUCCESS ) {
74 op->o_tmpfree( aa, op->o_tmpmemctx );