compare.c group.c modify.c modrdn.c delete.c init.c \
config.c bind.c attr.c filterindex.c unbind.c close.c \
alias.c tools.c key.c extended.c passwd.c sasl.c \
- referral.c attribute.c
+ referral.c attribute.c operational.c
OBJS = idl.lo add.lo search.lo cache.lo dbcache.lo dn2id.lo entry.lo \
id2entry.lo index.lo id2children.lo nextid.lo abandon.lo \
compare.lo group.lo modify.lo modrdn.lo delete.lo init.lo \
config.lo bind.lo attr.lo filterindex.lo unbind.lo close.lo \
alias.lo tools.lo key.lo extended.lo passwd.lo sasl.lo \
- referral.lo attribute.lo
+ referral.lo attribute.lo operational.lo
LDAP_INCDIR= ../../../include
LDAP_LIBDIR= ../../../libraries
AttributeDescription* entry_at,
struct berval ***vals));
+extern int ldbm_back_operational LDAP_P((BackendDB *bd,
+ Connection *conn, Operation *op,
+ Entry *e,
+ char **attrs,
+ int opattrs,
+ Attribute **a ));
/* hooks for slap tools */
extern int ldbm_tool_entry_open LDAP_P(( BackendDB *be, int mode ));
bi->bi_acl_group = ldbm_back_group;
bi->bi_acl_attribute = ldbm_back_attribute;
bi->bi_chk_referrals = ldbm_back_referrals;
+ bi->bi_operational = ldbm_back_operational;
/*
* hooks for slap tools
--- /dev/null
+/* operational.c - ldbm backend operational attributes function */
+/*
+ * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
+#include "portable.h"
+
+#include <stdio.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
+#include "slap.h"
+#include "back-ldbm.h"
+#include "proto-back-ldbm.h"
+
+/*
+ * sets the supported operational attributes (if required)
+ */
+
+int
+ldbm_back_operational(
+ BackendDB *be,
+ Connection *conn,
+ Operation *op,
+ Entry *e,
+ char **attrs,
+ int opattrs,
+ Attribute **a )
+{
+ Attribute **aa = a;
+
+ assert( e );
+
+ if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
+ int hs;
+
+ hs = has_children( be, e );
+
+ *aa = ch_malloc( sizeof( Attribute ) );
+ (*aa)->a_desc = slap_schema.si_ad_hasSubordinates;
+
+ (*aa)->a_vals = ch_malloc( 2 * sizeof( struct berval * ) );
+ (*aa)->a_vals[0] = ber_bvstrdup( hs ? "TRUE" : "FALSE" );
+ (*aa)->a_vals[1] = NULL;
+
+ (*aa)->a_next = NULL;
+ aa = &(*aa)->a_next;
+ }
+
+ return 0;
+}
+
Backend *be,
Connection *conn,
Operation *op,
- Entry *e )
+ Entry *e,
+ char **attrs,
+ int opattrs )
{
- Attribute *a = NULL;
+ Attribute *a = NULL, **ap = &a;
#ifdef SLAPD_SCHEMA_DN
a = ch_malloc( sizeof( Attribute ) );
a->a_vals[1] = NULL;
a->a_next = NULL;
+ ap = &a->a_next;
#endif
+ /*
+ * If operational attributes (allegedly) are required,
+ * and the backend supports specific operational attributes,
+ * add them to the attribute list
+ */
+ if ( ( opattrs || attrs ) && be->be_operational != NULL ) {
+ ( void )be->be_operational( be, conn, op, e,
+ attrs, opattrs, ap );
+ }
+
return a;
}
+
BackendDB *,
Connection *conn,
Operation *op,
- Entry * );
+ Entry *e,
+ char **attrs,
+ int opattrs );
/*
/* eventually will loop through generated operational attributes */
/* only have subschemaSubentry implemented */
- aa = backend_operational( be, conn, op, e );
+ aa = backend_operational( be, conn, op, e, attrs, opattrs );
for (a = aa ; a != NULL; a = a->a_next ) {
AttributeDescription *desc = a->a_desc;
SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
+attributetype ( 2.5.18.9 NAME 'hasSubordinates'
+ DESC 'X.501: entry has children'
+ EQUALITY booleanMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
+ SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
+
attributetype ( 2.5.18.10 NAME 'subschemaSubentry'
DESC 'RFC2252: name of controlling subschema entry'
EQUALITY distinguishedNameMatch
offsetof(struct slap_internal_schema, si_ad_modifiersName) },
{ "modifyTimestamp", NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_modifyTimestamp) },
+ { "hasSubordinates", NULL, NULL, NULL,
+ offsetof(struct slap_internal_schema, si_ad_hasSubordinates) },
{ "subschemaSubentry", NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
AttributeDescription *si_ad_createTimestamp;
AttributeDescription *si_ad_modifiersName;
AttributeDescription *si_ad_modifyTimestamp;
+ AttributeDescription *si_ad_hasSubordinates;
AttributeDescription *si_ad_subschemaSubentry;
/* root DSE attribute descriptions */
#define be_chk_referrals bd_info->bi_chk_referrals
#define be_group bd_info->bi_acl_group
#define be_attribute bd_info->bi_acl_attribute
+#define be_operational bd_info->bi_operational
#define be_controls bd_info->bi_controls
AttributeDescription *entry_at,
struct berval ***vals ));
+ int (*bi_operational) LDAP_P((Backend *bd,
+ struct slap_conn *c, struct slap_op *o,
+ Entry *e, char **attrs, int opattrs, Attribute **a ));
+
int (*bi_connection_init) LDAP_P((BackendDB *bd,
struct slap_conn *c));
int (*bi_connection_destroy) LDAP_P((BackendDB *bd,