]> git.sur5r.net Git - openldap/commitdiff
don't muck with shadow flags if database is already shadow (ITS#5850)
authorPierangelo Masarati <ando@openldap.org>
Sat, 6 Dec 2008 17:16:03 +0000 (17:16 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 6 Dec 2008 17:16:03 +0000 (17:16 +0000)
servers/slapd/bconfig.c

index bf78aabb56b55b8f454035e1b881da36a4ebdbbc..84976244f26269f14af58e12502a744ddb295a83 100644 (file)
@@ -3069,7 +3069,16 @@ config_shadow( ConfigArgs *c, int flag )
                return 1;
        }
 
-       SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SINGLE_SHADOW | flag);
+       if ( SLAP_SHADOW(c->be) ) {
+               /* if already shadow, only check consistency */
+               if ( ( SLAP_DBFLAGS(c->be) & flag ) != flag ) {
+                       Debug( LDAP_DEBUG_ANY, "%s: inconsistent shadow flag 0x%x.\n", c->log, flag, 0 );
+                       return 1;
+               }
+
+       } else {
+               SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SINGLE_SHADOW | flag);
+       }
 
        return 0;
 }