]> git.sur5r.net Git - openldap/blob - servers/slapd/operational.c
Fix nameAndOptionalUUID normalization,
[openldap] / servers / slapd / operational.c
1 /* operational.c - routines to deal with on-the-fly operational attrs */
2 /*
3  * Copyright 2001-2002 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #include "portable.h"
8
9 #include "slap.h"
10
11 /*
12  * helpers for on-the-fly operational attribute generation
13  */
14
15 #ifdef SLAPD_SCHEMA_DN
16 Attribute *
17 slap_operational_subschemaSubentry( void )
18 {
19         Attribute       *a;
20
21         a = ch_malloc( sizeof( Attribute ) );
22         a->a_desc = slap_schema.si_ad_subschemaSubentry;
23
24         /* Should be backend specific */
25         a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
26         ber_str2bv( SLAPD_SCHEMA_DN, sizeof(SLAPD_SCHEMA_DN)-1, 1, a->a_vals );
27         a->a_vals[1].bv_val = NULL;
28
29         a->a_next = NULL;
30         a->a_flags = 0;
31
32         return a;
33 }
34 #endif /* SLAPD_SCHEMA_DN */
35
36 Attribute *
37 slap_operational_hasSubordinate( int hs )
38 {
39         Attribute       *a;
40         
41         a = ch_malloc( sizeof( Attribute ) );
42         a->a_desc = slap_schema.si_ad_hasSubordinates;
43
44         a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
45         ber_str2bv( hs ? "TRUE" : "FALSE",
46                 hs ? sizeof("TRUE")-1 : sizeof("FALSE")-1,
47                 1, a->a_vals );
48         a->a_vals[1].bv_val = NULL;
49
50         a->a_next = NULL;
51         a->a_flags = 0;
52
53         return a;
54 }
55