]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/bconfig.c
fix ITS#3406 wrt/ dnattr; silence warning
[openldap] / servers / slapd / bconfig.c
index 4d1339d0af09eb1703f9270d994e675935594742..c8be76a17e52543c7f870e54b3f7da15541892be 100644 (file)
@@ -61,7 +61,7 @@ static struct oc_info {
                "DESC 'OpenLDAP Global configuration options' "
                "SUP olcConfig STRUCTURAL "
                "MAY ( olcAccess $ olcAllows $ olcArgsFile $ olcAttributeOptions $ "
-                "olcAuthRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ "
+                "olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ "
                 "olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ "
                 "olcDefaultSearchBase $ olcDisallows $ olcGentleHUP $ "
                 "olcIdleTimeout $ olcIndexSubstrIfMaxLen $ olcIndexSubstrIfMinLen $ "
@@ -275,6 +275,8 @@ config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
                rc = config_get_vals(&ct[i], c);
                if (rc == LDAP_SUCCESS) {
                        attr_merge(e, ct[i].ad, c->rvalue_vals, c->rvalue_nvals);
+                       ber_bvarray_free( c->rvalue_nvals );
+                       ber_bvarray_free( c->rvalue_vals );
                }
        }
 
@@ -387,12 +389,18 @@ config_back_db_open( BackendDB *be )
 
        /* Create database nodes... */
        for (i=0; i<nBackendDB; i++) {
+               slap_overinfo *oi = NULL;
                if ( i == 0 ) {
                        bptr = frontendDB;
                } else {
                        bptr = &backendDB[i];
                }
-               bi = bptr->bd_info;
+               if ( overlay_is_over( bptr )) {
+                       oi = bptr->bd_info->bi_private;
+                       bi = oi->oi_orig;
+               } else {
+                       bi = bptr->bd_info;
+               }
                rdn.bv_val = c.log;
                rdn.bv_len = sprintf(rdn.bv_val, "%s={%0x}%s", cfAd_database->ad_cname.bv_val,
                        i, bi->bi_type);
@@ -410,6 +418,31 @@ config_back_db_open( BackendDB *be )
                }
                ceprev = ce;
                /* Iterate through overlays */
+               if ( oi ) {
+                       slap_overinst *on;
+                       Entry *oe;
+                       CfEntryInfo *opar = ce, *oprev = NULL;
+                       int j;
+
+                       for (j=0,on=oi->oi_list; on; j++,on=on->on_next) {
+                               rdn.bv_val = c.log;
+                               rdn.bv_len = sprintf(rdn.bv_val, "%s={%0x}%s",
+                                       cfAd_overlay->ad_cname.bv_val, j, on->on_bi.bi_type );
+                               oe = config_alloc_entry( &e->e_nname, &rdn );
+                               ce = oe->e_private;
+                               c.be = bptr;
+                               c.bi = &on->on_bi;
+                               ce->ce_be = c.be;
+                               ce->ce_bi = c.bi;
+                               config_build_entry( &c, oe, cfOc_overlay, &rdn, ct, BI_TABLE );
+                               if ( !opar->ce_kids ) {
+                                       opar->ce_kids = ce;
+                               } else {
+                                       oprev->ce_sibs = ce;
+                               }
+                               oprev = ce;
+                       }
+               }
        }
 
        return 0;