mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #28617 from cachedout/umask_module_sync
Set restrictive umask on module sync
This commit is contained in:
commit
64a20228c6
1 changed files with 2 additions and 0 deletions
|
@ -92,6 +92,7 @@ def _sync(form, saltenv=None):
|
|||
remote = set()
|
||||
source = os.path.join('salt://_{0}'.format(form))
|
||||
mod_dir = os.path.join(__opts__['extension_modules'], '{0}'.format(form))
|
||||
cumask = os.umask(0o77)
|
||||
if not os.path.isdir(mod_dir):
|
||||
log.info('Creating module dir {0!r}'.format(mod_dir))
|
||||
try:
|
||||
|
@ -159,6 +160,7 @@ def _sync(form, saltenv=None):
|
|||
mod_file = os.path.join(__opts__['cachedir'], 'module_refresh')
|
||||
with salt.utils.fopen(mod_file, 'a+') as ofile:
|
||||
ofile.write('')
|
||||
os.umask(cumask)
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue