From: Howard Chu Date: Sat, 27 Nov 2004 11:45:54 +0000 (+0000) Subject: Add SLAP_DBFLAG_OVERLAY X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~201 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d3ced75fe7a482c74af64d18823dcd626d295071;p=openldap Add SLAP_DBFLAG_OVERLAY --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 0469f9b118..bd03c49500 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -1535,7 +1535,8 @@ int backend_operational( /* Let the overlays have a chance at this */ be_orig = op->o_bd; - op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 ); + if ( SLAP_ISOVERLAY( be_orig )) + op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 ); if (( SLAP_OPATTRS( rs->sr_attr_flags ) || op->ors_attrs ) && op->o_bd && op->o_bd->be_operational != NULL ) diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 1c9f783d1e..a834d702d7 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -178,6 +178,7 @@ over_back_response ( Operation *op, SlapReply *rs ) int rc = SLAP_CB_CONTINUE; BackendDB *be = op->o_bd, db = *op->o_bd; + db.be_flags |= SLAP_DBFLAG_OVERLAY; op->o_bd = &db; for (; on; on=on->on_next ) { if ( on->on_response ) { @@ -241,6 +242,7 @@ over_op_func( slap_callback cb = {NULL, over_back_response, NULL, NULL}; int rc = SLAP_CB_CONTINUE; + db.be_flags |= SLAP_DBFLAG_OVERLAY; op->o_bd = &db; cb.sc_next = op->o_callback; cb.sc_private = oi; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index f0bd6fa600..8c25d43e80 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1565,6 +1565,7 @@ struct slap_backend_db { #define SLAP_DBFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */ #define SLAP_DBFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */ #define SLAP_DBFLAG_GLUE_LINKED 0x0040U /* child is connected to parent */ +#define SLAP_DBFLAG_OVERLAY 0x0080U /* this db struct is an overlay */ #define SLAP_DBFLAG_SHADOW 0x8000U /* a shadow */ #define SLAP_DBFLAG_SYNC_SHADOW 0x1000U /* a sync shadow */ #define SLAP_DBFLAG_SLURP_SHADOW 0x2000U /* a slurp shadow */ @@ -1572,6 +1573,7 @@ struct slap_backend_db { #define SLAP_DBFLAGS(be) ((be)->be_flags) #define SLAP_NOLASTMOD(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD) #define SLAP_LASTMOD(be) (!SLAP_NOLASTMOD(be)) +#define SLAP_ISOVERLAY(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_OVERLAY) #define SLAP_NO_SCHEMA_CHECK(be) \ (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NO_SCHEMA_CHECK) #define SLAP_GLUE_INSTANCE(be) \