mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #42998 from vernondcole/bugfix/ignore_missing_parent_directory
Routine fell back to eauth gently if keyfile was missing, but errored…
This commit is contained in:
commit
b3aa9ab394
@ -189,15 +189,14 @@ class LocalClient(object):
|
|||||||
key_user = key_user.replace(u'\\', u'_')
|
key_user = key_user.replace(u'\\', u'_')
|
||||||
keyfile = os.path.join(self.opts[u'cachedir'],
|
keyfile = os.path.join(self.opts[u'cachedir'],
|
||||||
u'.{0}_key'.format(key_user))
|
u'.{0}_key'.format(key_user))
|
||||||
|
try:
|
||||||
# Make sure all key parent directories are accessible
|
# Make sure all key parent directories are accessible
|
||||||
salt.utils.verify.check_path_traversal(self.opts[u'cachedir'],
|
salt.utils.verify.check_path_traversal(self.opts[u'cachedir'],
|
||||||
key_user,
|
key_user,
|
||||||
self.skip_perm_errors)
|
self.skip_perm_errors)
|
||||||
|
|
||||||
try:
|
|
||||||
with salt.utils.files.fopen(keyfile, u'r') as key:
|
with salt.utils.files.fopen(keyfile, u'r') as key:
|
||||||
return key.read()
|
return key.read()
|
||||||
except (OSError, IOError):
|
except (OSError, IOError, SaltClientError):
|
||||||
# Fall back to eauth
|
# Fall back to eauth
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user