mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Make sure that child zones accept commands from their parent zone
refs #6964
This commit is contained in:
parent
f1c8073dd3
commit
913e35da9e
@ -982,8 +982,14 @@ Value ApiEvents::UpdateRepositoryAPIHandler(const MessageOrigin& origin, const D
|
|||||||
|
|
||||||
Host::Ptr ApiEvents::FindHostByVirtualName(const String& hostName, const MessageOrigin& origin)
|
Host::Ptr ApiEvents::FindHostByVirtualName(const String& hostName, const MessageOrigin& origin)
|
||||||
{
|
{
|
||||||
if (origin.FromZone && hostName == "localhost")
|
if (origin.FromZone) {
|
||||||
return Host::GetByName(origin.FromZone->GetName());
|
Zone::Ptr my_zone = Zone::GetLocalZone();
|
||||||
else
|
|
||||||
return Host::GetByName(hostName);
|
if (origin.FromZone->IsChildOf(my_zone) && hostName == "localhost")
|
||||||
|
return Host::GetByName(origin.FromZone->GetName());
|
||||||
|
else if (!origin.FromZone->IsChildOf(my_zone) && hostName == my_zone->GetName())
|
||||||
|
return Host::GetByName("localhost");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Host::GetByName(hostName);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user