]> git.sur5r.net Git - openldap/blob - servers/slapd/operational.c
989b11b155d8cbb863ee8d514488c7181646f5f0
[openldap] / servers / slapd / operational.c
1 /* operational.c - routines to deal with on-the-fly operational attrs */
2 /*
3  * Copyright 2001 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         a->a_vals[0] = ber_bvstrdup( SLAPD_SCHEMA_DN );
27         a->a_vals[1] = NULL;
28
29         a->a_next = NULL;
30
31         return a;
32 }
33 #endif /* SLAPD_SCHEMA_DN */
34
35 Attribute *
36 slap_operational_hasSubordinate( int hs )
37 {
38         Attribute       *a;
39         
40         a = ch_malloc( sizeof( Attribute ) );
41         a->a_desc = slap_schema.si_ad_hasSubordinates;
42
43         a->a_vals = ch_malloc( 2 * sizeof( struct berval * ) );
44         a->a_vals[0] = ber_bvstrdup( hs ? "TRUE" : "FALSE" );
45         a->a_vals[1] = NULL;
46
47         a->a_next = NULL;
48
49         return a;
50 }
51