From a8c1438688f74081257d2aaba4e12814b9c8668f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 17 May 2013 09:15:36 -0700 Subject: [PATCH] ITS#7577 more alias deref checks --- servers/slapd/back-mdb/dn2id.c | 8 ++++++++ servers/slapd/back-mdb/search.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-mdb/dn2id.c b/servers/slapd/back-mdb/dn2id.c index 64c5634e24..22187b957a 100644 --- a/servers/slapd/back-mdb/dn2id.c +++ b/servers/slapd/back-mdb/dn2id.c @@ -714,6 +714,14 @@ mdb_idscopes( } id = isc->id; + + /* Catch entries from deref'd aliases */ + x = mdb_id2l_search( isc->scopes, id ); + if ( x <= isc->scopes[0].mid && isc->scopes[x].mid == id ) { + isc->nscope = x; + return MDB_SUCCESS; + } + while (id) { if ( !rc ) { key.mv_data = &id; diff --git a/servers/slapd/back-mdb/search.c b/servers/slapd/back-mdb/search.c index 0b2057202b..24f3ee4cbc 100644 --- a/servers/slapd/back-mdb/search.c +++ b/servers/slapd/back-mdb/search.c @@ -858,7 +858,7 @@ notfound: int i; /* child of base, just append RDNs to base->e_name */ - if ( nsubs < ncand || isc.nscope == 1 ) { + if ( nsubs < ncand || isc.scopes[isc.nscope].mid == base->e_id ) { pdn = base->e_name; pndn = base->e_nname; } else { -- 2.39.5