From: Pierangelo Masarati Date: Sat, 6 Dec 2008 17:16:03 +0000 (+0000) Subject: don't muck with shadow flags if database is already shadow (ITS#5850) X-Git-Tag: ACLCHECK_0~1032 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d8e4b48cee90354133ba0f777f346ce129c4ce68;p=openldap don't muck with shadow flags if database is already shadow (ITS#5850) --- 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; }