return 0;
}
-void backend_destroy_one( BackendDB *bd )
+void backend_destroy_one( BackendDB *bd, int dynamic )
{
- LDAP_STAILQ_REMOVE(&backendDB, bd, slap_backend_db, be_next );
+ if ( dynamic ) {
+ LDAP_STAILQ_REMOVE(&backendDB, bd, slap_backend_db, be_next );
+ }
if ( bd->be_syncinfo ) {
syncinfo_free( bd->be_syncinfo );
csne = LDAP_TAILQ_NEXT( csne, ce_csn_link );
ch_free( tmp_csne );
}
+ ch_free( bd->be_pending_csn_list );
}
if ( bd->bd_info->bi_db_destroy ) {
free( bd->be_rootpw.bv_val );
}
acl_destroy( bd->be_acl, frontendDB->be_acl );
- free( bd );
+ if ( dynamic ) {
+ free( bd );
+ }
}
int backend_destroy(void)
/* destroy each backend database */
while (( bd = LDAP_STAILQ_FIRST(&backendDB))) {
- backend_destroy_one( bd );
+ backend_destroy_one( bd, 1 );
}
/* destroy each backend type */
}
int
-backend_group(
+fe_acl_group(
Operation *op,
Entry *target,
struct berval *gr_ndn,
GroupAssertion *g;
Backend *be = op->o_bd;
- if ( op->o_abandon ) return SLAPD_ABANDON;
-
op->o_bd = select_backend( gr_ndn, 0, 0 );
for ( g = op->o_groups; g; g = g->ga_next ) {
}
int
-backend_attribute(
+backend_group(
+ Operation *op,
+ Entry *target,
+ struct berval *gr_ndn,
+ struct berval *op_ndn,
+ ObjectClass *group_oc,
+ AttributeDescription *group_at )
+{
+ int rc;
+ BackendDB *be_orig;
+
+ if ( op->o_abandon ) {
+ return SLAPD_ABANDON;
+ }
+
+ be_orig = op->o_bd;
+ op->o_bd = frontendDB;
+ rc = frontendDB->be_group( op, target, gr_ndn,
+ op_ndn, group_oc, group_at );
+ op->o_bd = be_orig;
+
+ return rc;
+}
+
+int
+fe_acl_attribute(
Operation *op,
Entry *target,
struct berval *edn,
return rc;
}
+int
+backend_attribute(
+ Operation *op,
+ Entry *target,
+ struct berval *edn,
+ AttributeDescription *entry_at,
+ BerVarray *vals,
+ slap_access_t access )
+{
+ int rc;
+ BackendDB *be_orig;
+
+ be_orig = op->o_bd;
+ op->o_bd = frontendDB;
+ rc = frontendDB->be_attribute( op, target, edn,
+ entry_at, vals, access );
+ op->o_bd = be_orig;
+
+ return rc;
+}
+
int
backend_access(
Operation *op,
return rc;
}
-int backend_operational(
+int
+fe_aux_operational(
Operation *op,
SlapReply *rs )
{
- Attribute **ap;
- int rc = 0;
- BackendDB *be_orig;
+ Attribute **ap;
+ int rc = 0;
+ BackendDB *be_orig;
for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
/* just count them */ ;
ap = &(*ap)->a_next;
}
- if ( op->o_bd != NULL )
+ if ( op->o_bd != NULL && op->o_bd != frontendDB )
{
/* Let the overlays have a chance at this */
be_orig = op->o_bd;
return rc;
}
+int backend_operational( Operation *op, SlapReply *rs )
+{
+ int rc;
+ BackendDB *be_orig;
+
+ /* Moved this into the frontend so global overlays are called */
+
+ be_orig = op->o_bd;
+ op->o_bd = frontendDB;
+ rc = frontendDB->be_operational( op, rs );
+ op->o_bd = be_orig;
+
+ return rc;
+}
+