From 9dcad37acfc9769f39d22e1b672fc4d20e833751 Mon Sep 17 00:00:00 2001
From: Arkaitz Jimenez <arkaitzj@gmail.com>
Date: Mon, 8 Apr 2013 17:35:45 +0000
Subject: [PATCH] Remove the umask requirement, set the proper permissions to
 base_path

---
 cdist/exec/remote.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py
index d4d2cb2b..4c029752 100644
--- a/cdist/exec/remote.py
+++ b/cdist/exec/remote.py
@@ -60,6 +60,7 @@ class Remote(object):
     def create_files_dirs(self):
         self.rmdir(self.base_path)
         self.mkdir(self.base_path)
+        self.run(["/bin/chmod", "700", self.base_path])
         self.mkdir(self.conf_path)
 
     def rmdir(self, path):
@@ -100,9 +101,6 @@ class Remote(object):
         cmd = self._exec.split()
         cmd.append(self.target_host)
 
-        # Always call umask before actual call to ensure proper file permissions
-        cmd.append("umask 077;")
-
         # FIXME: replace this by -o SendEnv name -o SendEnv name ... to ssh?
         # can't pass environment to remote side, so prepend command with
         # variable declarations