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 );
27 op->o_tmpfree( (char *) ava, op->o_tmpmemctx );
35 AttributeAssertion **ava,
42 struct berval type, value;
43 AttributeAssertion *aa;
45 rtag = ber_scanf( ber, "{mm}", &type, &value );
47 if( rtag == LBER_ERROR ) {
49 LDAP_LOG( FILTER, ERR, "get_ava: ber_scanf failure\n", 0, 0, 0 );
51 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
53 *text = "Error decoding attribute value assertion";
54 return SLAPD_DISCONNECT;
57 aa = op->o_tmpalloc( sizeof( AttributeAssertion ), op->o_tmpmemctx );
59 aa->aa_value.bv_val = NULL;
61 rc = slap_bv2ad( &type, &aa->aa_desc, text );
63 if( rc != LDAP_SUCCESS ) {
64 op->o_tmpfree( aa, op->o_tmpmemctx );
68 rc = asserted_value_validate_normalize(
69 aa->aa_desc, ad_mr(aa->aa_desc, usage),
70 usage, &value, &aa->aa_value, text, op->o_tmpmemctx );
72 if( rc != LDAP_SUCCESS ) {
73 op->o_tmpfree( aa, op->o_tmpmemctx );