Skip to content

Commit

Permalink
Fix update execution message discarded. refs #8616
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Codato committed Feb 8, 2021
1 parent ddbad79 commit 05f8a6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/icinga/clusterevents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,8 @@ Value ClusterEvents::ExecutedCommandAPIHandler(const MessageOrigin::Ptr& origin,

ObjectLock oLock (checkable);

if (origin->FromZone && !origin->FromZone->CanAccessObject(checkable)) {
if (origin->FromZone && !origin->FromZone->CanAccessObject(checkable) &&
endpoint->GetName() != host->GetName()) {
Log(LogNotice, "ClusterEvents")
<< "Discarding 'update executions API handler' message for checkable '" << checkable->GetName()
<< "' from '" << origin->FromClient->GetIdentity() << "': Unauthorized access.";
Expand Down Expand Up @@ -1252,7 +1253,8 @@ Value ClusterEvents::UpdateExecutionsAPIHandler(const MessageOrigin::Ptr& origin

ObjectLock oLock (checkable);

if (origin->FromZone && !origin->FromZone->CanAccessObject(checkable)) {
if (origin->FromZone && !origin->FromZone->CanAccessObject(checkable) &&
endpoint->GetName() != host->GetName()) {
Log(LogNotice, "ClusterEvents")
<< "Discarding 'update executions API handler' message for checkable '" << checkable->GetName()
<< "' from '" << origin->FromClient->GetIdentity() << "': Unauthorized access.";
Expand Down

0 comments on commit 05f8a6d

Please sign in to comment.