mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-22 18:22:12 +01:00
Merge pull request #1138 from dmach/0.x/fix-crash-.ssh-dir-missing
Fix crash in ssh auth when .ssh directory is missing
This commit is contained in:
commit
759537807c
@ -618,8 +618,12 @@ def _build_opener(apiurl):
|
||||
return parts[1]
|
||||
|
||||
def list_ssh_dir_keys(self):
|
||||
sshdir = os.path.expanduser('~/.ssh')
|
||||
keys_in_home_ssh = {}
|
||||
|
||||
sshdir = os.path.expanduser('~/.ssh')
|
||||
if not os.path.isdir(sshdir):
|
||||
return keys_in_home_ssh
|
||||
|
||||
for keyfile in os.listdir(sshdir):
|
||||
if keyfile.startswith(("agent-", "authorized_keys", "config", "known_hosts")):
|
||||
# skip files that definitely don't contain keys
|
||||
|
Loading…
x
Reference in New Issue
Block a user