From d8e4b48cee90354133ba0f777f346ce129c4ce68 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 6 Dec 2008 17:16:03 +0000 Subject: [PATCH] don't muck with shadow flags if database is already shadow (ITS#5850) --- servers/slapd/bconfig.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index bf78aabb56..84976244f2 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -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; } -- 2.39.5