mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Prevent failed os.makedirs from leaving modified umask in place
This commit is contained in:
parent
633e1208e4
commit
82ce546e18
1 changed files with 4 additions and 2 deletions
|
@ -106,8 +106,10 @@ def need_deployment():
|
|||
if os.path.exists(OPTIONS.saltdir):
|
||||
shutil.rmtree(OPTIONS.saltdir)
|
||||
old_umask = os.umask(0o077)
|
||||
os.makedirs(OPTIONS.saltdir)
|
||||
os.umask(old_umask)
|
||||
try:
|
||||
os.makedirs(OPTIONS.saltdir)
|
||||
finally:
|
||||
os.umask(old_umask)
|
||||
# Verify perms on saltdir
|
||||
if not is_windows():
|
||||
euid = os.geteuid()
|
||||
|
|
Loading…
Add table
Reference in a new issue