return rc;
}
-int backend_operational(
- Operation *op,
- SlapReply *rs )
+int backend_operational( Operation *op, SlapReply *rs )
{
- Attribute **ap;
- int rc = 0;
- BackendDB *be_orig;
-
- for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
- /* just count them */ ;
-
- /*
- * If operational attributes (allegedly) are required,
- * and the backend supports specific operational attributes,
- * add them to the attribute list
- */
- if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
- ad_inlist( slap_schema.si_ad_entryDN, rs->sr_attrs ) ) )
- {
- *ap = slap_operational_entryDN( rs->sr_entry );
- ap = &(*ap)->a_next;
- }
-
- if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
- ad_inlist( slap_schema.si_ad_subschemaSubentry, rs->sr_attrs ) ) )
- {
- *ap = slap_operational_subschemaSubentry( op->o_bd );
- ap = &(*ap)->a_next;
- }
+ int rc;
+ BackendDB *be_orig;
- if ( op->o_bd != NULL )
- {
- /* Let the overlays have a chance at this */
- be_orig = op->o_bd;
- if ( SLAP_ISOVERLAY( be_orig ) )
- op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
+ /* Moved this into the frontend so global overlays are called */
- if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
- op->o_bd && op->o_bd->be_operational != NULL )
- {
- rc = op->o_bd->be_operational( op, rs );
- }
- op->o_bd = be_orig;
- }
+ be_orig = op->o_bd;
+ op->o_bd = frontendDB;
+ rc = frontendDB->be_operational( op, rs );
+ op->o_bd = be_orig;
return rc;
}
static BackendDB slap_frontendDB;
BackendDB *frontendDB;
+static int
+fe_aux_operational(
+ Operation *op,
+ SlapReply *rs )
+{
+ Attribute **ap;
+ int rc = 0;
+ BackendDB *be_orig;
+
+ for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
+ /* just count them */ ;
+
+ /*
+ * If operational attributes (allegedly) are required,
+ * and the backend supports specific operational attributes,
+ * add them to the attribute list
+ */
+ if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
+ ad_inlist( slap_schema.si_ad_entryDN, rs->sr_attrs ) ) )
+ {
+ *ap = slap_operational_entryDN( rs->sr_entry );
+ ap = &(*ap)->a_next;
+ }
+
+ if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
+ ad_inlist( slap_schema.si_ad_subschemaSubentry, rs->sr_attrs ) ) )
+ {
+ *ap = slap_operational_subschemaSubentry( op->o_bd );
+ ap = &(*ap)->a_next;
+ }
+
+ if ( op->o_bd != NULL )
+ {
+ /* Let the overlays have a chance at this */
+ be_orig = op->o_bd;
+ if ( SLAP_ISOVERLAY( be_orig ) )
+ op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
+
+ if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
+ op->o_bd && op->o_bd->be_operational != NULL )
+ {
+ rc = op->o_bd->be_operational( op, rs );
+ }
+ op->o_bd = be_orig;
+ }
+
+ return rc;
+}
+
int
frontend_init( void )
{
frontendDB->bd_info->bi_op_modrdn = fe_op_modrdn;
frontendDB->bd_info->bi_op_search = fe_op_search;
frontendDB->bd_info->bi_extended = fe_extended;
+ frontendDB->bd_info->bi_operational = fe_aux_operational;
#if 0
/* FIXME: is this too early? */
else
rc = LDAP_SUCCESS; /* confusing: don't abort, but don't send */
- if ( rc == SLAP_CB_CONTINUE && rs->sr_type == REP_SEARCH ) {
- /* XXX we shouldn't need this here */
- slapi_over_aux_operational( op, rs );
- }
-
slapi_pblock_set( pb, SLAPI_RESCONTROLS, NULL ); /* don't free */
slapi_pblock_destroy(pb);