mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Prevent failed os.makedirs from leaving modified umask in place
This commit is contained in:
parent
633e1208e4
commit
82ce546e18
@ -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…
Reference in New Issue
Block a user