]> git.sur5r.net Git - openldap/commitdiff
Fix dn2idl when suffix = ""
authorHoward Chu <hyc@openldap.org>
Tue, 7 Oct 2008 22:52:59 +0000 (22:52 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 7 Oct 2008 22:52:59 +0000 (22:52 +0000)
servers/slapd/back-bdb/dn2id.c

index a358fe0d668f167aab6ae44d7ec4dc72718895d4..fd557ea29488fa59d473253ddaedeb28c05c8e19 100644 (file)
@@ -393,7 +393,8 @@ bdb_dn2idl(
 
 #ifndef        BDB_MULTIPLE_SUFFIXES
        if ( prefix == DN_SUBTREE_PREFIX
-               && ( ei->bei_id == 0 || ei->bei_parent->bei_id == 0 )) {
+               && ( ei->bei_id == 0 ||
+               ( ei->bei_parent->bei_id == 0 && op->o_bd->be_suffix[0].bv_len ))) {
                BDB_IDL_ALL(bdb, ids);
                return 0;
        }
@@ -1184,7 +1185,7 @@ hdb_dn2idl(
 #ifndef BDB_MULTIPLE_SUFFIXES
        if ( op->ors_scope != LDAP_SCOPE_ONELEVEL && 
                ( ei->bei_id == 0 ||
-               ei->bei_parent->bei_id == 0 ))
+               ( ei->bei_parent->bei_id == 0 && op->o_bd->be_suffix[0].bv_len )))
        {
                BDB_IDL_ALL( bdb, ids );
                return 0;