From: Michael Friedrich Date: Wed, 19 Jun 2019 15:00:50 +0000 (+0200) Subject: Config sync: Only copy paths to prod which are actually there X-Git-Tag: v2.11.0-rc1~59^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08a47600be3e9be87b702aa81157a9eb013b27ab;p=icinga2 Config sync: Only copy paths to prod which are actually there Stored files may be removed by external sources. --- diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index 42c4737fe..f3d5a5d48 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -547,6 +547,9 @@ void ApiListener::TryActivateZonesStageCallback(const ProcessResult& pr, // Copy all synced configuration files from stage to production. for (const String& path : relativePaths) { + if (!Utility::PathExists(path)) + continue; + Log(LogInformation, "ApiListener") << "Copying file '" << path << "' from config sync staging to production zones directory.";