Merge pull request #10215 from NicolasLM/vault-view-umask

Set proper permissions for ansible-vault view
This commit is contained in:
Brian Coca 2015-02-11 09:48:07 -05:00
commit 4b0cc9152d

View file

@ -281,8 +281,10 @@ class VaultEditor(object):
tmpdata = self.read_data(self.filename)
this_vault = VaultLib(self.password)
dec_data = this_vault.decrypt(tmpdata)
old_umask = os.umask(0o077)
_, tmp_path = tempfile.mkstemp()
self.write_data(dec_data, tmp_path)
os.umask(old_umask)
# drop the user into pager on the tmp file
call(self._pager_shell_command(tmp_path))