]> git.sur5r.net Git - openldap/commitdiff
ITS#5284
authorQuanah Gibson-Mount <quanah@openldap.org>
Fri, 8 Feb 2008 21:34:35 +0000 (21:34 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 8 Feb 2008 21:34:35 +0000 (21:34 +0000)
CHANGES
servers/slapd/bconfig.c

diff --git a/CHANGES b/CHANGES
index 4dcc64f356687f1e26a8b0a2741b60dac01b6271..d23513cc31d30ae3a8023efab9abe35b07285fe3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,7 @@ OpenLDAP 2.4.8 Engineering
        Fixed slapd include handling (ITS#5276)
        Fixed slapd non-atomic signal variables (ITS#5248)
        Fixed slapd-ldif delete (ITS#5265)
+       Fixed slapd overlay ordering when moving to slapd.d (ITS#5284)
        Fixed test047 to skip if rwm is not available (ITS#5292)
        Build Environment
                Fixed libldap_r threaded library linking (ITS#4982)
index 10fec37525e931f6dd2290cd49e62220ae20f2d8..e394c3d787d9eedafcb96f986dadd90c422c146c 100644 (file)
@@ -797,6 +797,11 @@ typedef struct ServerID {
 
 static ServerID *sid_list;
 
+typedef struct voidList {
+       struct voidList *vl_next;
+       void *vl_ptr;
+} voidList;
+
 typedef struct ADlist {
        struct ADlist *al_next;
        AttributeDescription *al_desc;
@@ -5759,8 +5764,19 @@ config_back_db_open( BackendDB *be, ConfigReply *cr )
                        slap_overinst *on;
                        Entry *oe;
                        int j;
-
-                       for (j=0,on=oi->oi_list; on; j++,on=on->on_next) {
+                       voidList *vl, *v0 = NULL;
+
+                       /* overlays are in LIFO order, must reverse stack */
+                       for (on=oi->oi_list; on; on=on->on_next) {
+                               vl = ch_malloc( sizeof( voidList ));
+                               vl->vl_next = v0;
+                               v0 = vl;
+                               vl->vl_ptr = on;
+                       }
+                       for (j=0; vl; j++,vl=v0) {
+                               on = vl->vl_ptr;
+                               v0 = vl->vl_next;
+                               ch_free( vl );
                                if ( on->on_bi.bi_db_config && !on->on_bi.bi_cf_ocs ) {
                                        Debug( LDAP_DEBUG_ANY,
                                                "WARNING: No dynamic config support for overlay %s.\n",