diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index f6f868a30d..77dcf4a422 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -614,7 +614,13 @@ select_backend( continue; } } else { - b2 = be; + /* If any parts of the tree are glued, use the first + * match regardless of manageDSAit. Otherwise use the + * last match. + */ + if( !( SLAP_DBFLAGS( be ) & ( SLAP_DBFLAG_GLUE_INSTANCE | + SLAP_DBFLAG_GLUE_SUBORDINATE ))) + b2 = be; } return b2; }