Merge pull request #10215 from NicolasLM/vault-view-umask
Set proper permissions for ansible-vault view
This commit is contained in:
commit
4b0cc9152d
1 changed files with 2 additions and 0 deletions
|
@ -281,8 +281,10 @@ class VaultEditor(object):
|
||||||
tmpdata = self.read_data(self.filename)
|
tmpdata = self.read_data(self.filename)
|
||||||
this_vault = VaultLib(self.password)
|
this_vault = VaultLib(self.password)
|
||||||
dec_data = this_vault.decrypt(tmpdata)
|
dec_data = this_vault.decrypt(tmpdata)
|
||||||
|
old_umask = os.umask(0o077)
|
||||||
_, tmp_path = tempfile.mkstemp()
|
_, tmp_path = tempfile.mkstemp()
|
||||||
self.write_data(dec_data, tmp_path)
|
self.write_data(dec_data, tmp_path)
|
||||||
|
os.umask(old_umask)
|
||||||
|
|
||||||
# drop the user into pager on the tmp file
|
# drop the user into pager on the tmp file
|
||||||
call(self._pager_shell_command(tmp_path))
|
call(self._pager_shell_command(tmp_path))
|
||||||
|
|
Loading…
Reference in a new issue