From: Howard Chu Date: Fri, 17 May 2013 16:15:36 +0000 (-0700) Subject: ITS#7577 more alias deref checks X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a8c1438688f74081257d2aaba4e12814b9c8668f;p=openldap ITS#7577 more alias deref checks --- 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 {