]> git.sur5r.net Git - openldap/commitdiff
ITS#7577 more alias deref checks
authorHoward Chu <hyc@openldap.org>
Fri, 17 May 2013 16:15:36 +0000 (09:15 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 24 May 2013 19:28:18 +0000 (12:28 -0700)
servers/slapd/back-mdb/dn2id.c
servers/slapd/back-mdb/search.c

index 64c5634e24532cd74757bb2077be6a1ae66e41b4..22187b957a502238b6523bb485bf410231b8f5f4 100644 (file)
@@ -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;
index 0b2057202bf212abaaba6e9d7fb007ccaa118602..24f3ee4cbcd8457dd65c8d7c9344f1ddf50ec649 100644 (file)
@@ -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 {