Set proper permissions for ansible-vault view

This commit is contained in:
Nicolas Le Manchet 2015-02-11 14:15:38 +01:00
parent 67fb39451a
commit faa2449f55

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))