1 /* operational.c - routines to deal with on-the-fly operational attrs */
3 * Copyright 2001-2003 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 * helpers for on-the-fly operational attribute generation
16 slap_operational_subschemaSubentry( Backend *be )
20 /* The backend wants to take care of it */
21 if ( be && be->be_schemadn.bv_val ) return NULL;
23 a = ch_malloc( sizeof( Attribute ) );
24 a->a_desc = slap_schema.si_ad_subschemaSubentry;
26 a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
27 ber_dupbv( a->a_vals, &global_schemadn );
28 a->a_vals[1].bv_len = 0;
29 a->a_vals[1].bv_val = NULL;
31 a->a_nvals = ch_malloc( 2 * sizeof( struct berval ) );
32 ber_dupbv( a->a_nvals, &global_schemandn );
33 a->a_nvals[1].bv_len = 0;
34 a->a_nvals[1].bv_val = NULL;
43 slap_operational_hasSubordinate( int hs )
51 len = sizeof( "TRUE" ) - 1;
55 len = sizeof( "FALSE" ) - 1;
59 a = ch_malloc( sizeof( Attribute ) );
60 a->a_desc = slap_schema.si_ad_hasSubordinates;
61 a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
63 ber_str2bv( val, len, 1, a->a_vals );
64 a->a_vals[1].bv_val = NULL;
66 a->a_nvals = a->a_vals;