use os.umask locally
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								67a95b50aa
							
						
					
				
			
			
				commit
				
					
						1b8b54f84f
					
				
			
		
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -60,6 +60,9 @@ class Local(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.log = logging.getLogger(self.target_host)
 | 
					        self.log = logging.getLogger(self.target_host)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Setup file permissions using umask
 | 
				
			||||||
 | 
					        os.umask(0o700)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def create_directories(self):
 | 
					    def create_directories(self):
 | 
				
			||||||
        self.mkdir(self.out_path)
 | 
					        self.mkdir(self.out_path)
 | 
				
			||||||
        self.mkdir(self.global_explorer_out_path)
 | 
					        self.mkdir(self.global_explorer_out_path)
 | 
				
			||||||
| 
						 | 
					@ -73,8 +76,7 @@ class Local(object):
 | 
				
			||||||
    def mkdir(self, path):
 | 
					    def mkdir(self, path):
 | 
				
			||||||
        """Create directory on the local side."""
 | 
					        """Create directory on the local side."""
 | 
				
			||||||
        self.log.debug("Local mkdir: %s", path)
 | 
					        self.log.debug("Local mkdir: %s", path)
 | 
				
			||||||
        # FIXME: dont set mode here, fix unittest mkdtemp instead
 | 
					        os.makedirs(path, exist_ok=True)
 | 
				
			||||||
        os.makedirs(path, mode=0o700, exist_ok=True)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self, command, env=None, return_output=False):
 | 
					    def run(self, command, env=None, return_output=False):
 | 
				
			||||||
        """Run the given command with the given environment.
 | 
					        """Run the given command with the given environment.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue