]> granicus.if.org Git - icinga2/commitdiff
Use MkDirP instead of MkDir when syncing zone configs
authorGunnar Beutner <gunnar@beutner.name>
Tue, 26 Jan 2016 09:45:03 +0000 (10:45 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 26 Jan 2016 09:45:03 +0000 (10:45 +0100)
fixes #10932

lib/remote/apilistener-filesync.cpp

index 7da0763b18c940938c0751e162783f8a1e12935b..bc1d1110282ffea5ddce9ab45790c90f209b4292 100644 (file)
@@ -143,7 +143,7 @@ void ApiListener::SyncZoneDir(const Zone::Ptr& zone) const
        Log(LogInformation, "ApiListener")
            << "Copying " << newConfig->GetLength() << " zone configuration files for zone '" << zone->GetName() << "' to '" << oldDir << "'.";
 
-       Utility::MkDir(oldDir, 0700);
+       Utility::MkDirP(oldDir, 0700);
 
        Dictionary::Ptr oldConfig = LoadConfigDir(oldDir);
 
@@ -244,7 +244,7 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
 
                String oldDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones/" + zone->GetName();
 
-               Utility::MkDir(oldDir, 0700);
+               Utility::MkDirP(oldDir, 0700);
 
                Dictionary::Ptr newConfig = kv.second;
                Dictionary::Ptr oldConfig = LoadConfigDir(oldDir);