]> git.sur5r.net Git - openldap/commitdiff
open database using the real structure (partial fix to ITS#5724)
authorPierangelo Masarati <ando@openldap.org>
Sun, 5 Oct 2008 21:11:13 +0000 (21:11 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 5 Oct 2008 21:11:13 +0000 (21:11 +0000)
servers/slapd/backover.c

index f0194a739ddef138b17eacfbe05a9bc833353762..58ca3198fc994e35cf24641ada97c458381bdd76 100644 (file)
@@ -138,22 +138,25 @@ over_db_open(
 {
        slap_overinfo *oi = be->bd_info->bi_private;
        slap_overinst *on = oi->oi_list;
-       BackendDB db = *be;
+       BackendInfo *bi_orig = be->bd_info;
        int rc = 0;
 
-       db.be_flags |= SLAP_DBFLAG_OVERLAY;
-       db.bd_info = oi->oi_orig;
-       if ( db.bd_info->bi_db_open ) {
-               rc = db.bd_info->bi_db_open( &db, cr );
+       be->be_flags |= SLAP_DBFLAG_OVERLAY;
+       be->bd_info = oi->oi_orig;
+       if ( be->bd_info->bi_db_open ) {
+               rc = be->bd_info->bi_db_open( be, cr );
        }
 
        for (; on && rc == 0; on=on->on_next) {
-               db.bd_info = &on->on_bi;
-               if ( db.bd_info->bi_db_open ) {
-                       rc = db.bd_info->bi_db_open( &db, cr );
+               be->bd_info = &on->on_bi;
+               if ( be->bd_info->bi_db_open ) {
+                       rc = be->bd_info->bi_db_open( be, cr );
                }
        }
 
+       be->bd_info = bi_orig;
+       be->be_flags ^= SLAP_DBFLAG_OVERLAY;
+
        return rc;
 }