Merge pull request #6379 from Icinga/global-zone-validation

Throw config error when using global zones as parent
This commit is contained in:
Michael Friedrich 2018-07-26 10:01:46 +02:00 committed by GitHub
commit 038b2fb94c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,9 @@ void Zone::OnAllConfigLoaded()
m_Parent = Zone::GetByName(GetParentRaw());
if (m_Parent && m_Parent->IsGlobal())
BOOST_THROW_EXCEPTION(ScriptError("Zone '" + GetName() + "' can not have a global zone as parent.", GetDebugInfo()));
Zone::Ptr zone = m_Parent;
int levels = 0;