X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackglue.c;h=cce5905ee1b827595b6ea2bd2a8037e8765a0804;hb=fb2d3926ce4714b83f76c059a18a0d67d12b8019;hp=21b7e52ae126dc92be3a7783b5bc548371c7726b;hpb=bc8550e3c2ec46bd8c92fd1714fa8fca8a2eea79;p=openldap diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 21b7e52ae1..cce5905ee1 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -262,6 +262,13 @@ glue_chk_controls ( Operation *op, SlapReply *rs ) return rc; } +/* ITS#4615 - overlays configured above the glue overlay should be + * invoked for the entire glued tree. Overlays configured below the + * glue overlay should only be invoked on the master backend. + * So, if we're searching on any subordinates, we need to force the + * current overlay chain to stop processing, without stopping the + * overall callback flow. + */ static int glue_sub_search( Operation *op, SlapReply *rs, BackendDB *b0, slap_overinst *on ) @@ -775,6 +782,13 @@ glue_db_init( BackendInfo *bi = oi->oi_orig; glueinfo *gi; + if ( SLAP_GLUE_SUBORDINATE( be )) { + Debug( LDAP_DEBUG_ANY, "glue: backend %s is already subordinate, " + "cannot have glue overlay!\n", + be->be_suffix[0].bv_val, 0, 0 ); + return LDAP_OTHER; + } + gi = ch_calloc( 1, sizeof(glueinfo)); on->on_bi.bi_private = gi; dnParent( be->be_nsuffix, &gi->gi_pdn ); @@ -960,6 +974,12 @@ glue_sub_add( BackendDB *be, int advert, int online ) glue_Addrec *ga; int rc = 0; + if ( overlay_is_inst( be, "glue" )) { + Debug( LDAP_DEBUG_ANY, "glue: backend %s already has glue overlay, " + "cannot be a subordinate!\n", + be->be_suffix[0].bv_val, 0, 0 ); + return LDAP_OTHER; + } SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_SUBORDINATE; if ( advert ) SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_ADVERTISE;