Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_private_keys: do not try to read sockets #147

Merged
merged 2 commits into from
Jan 20, 2019

Conversation

sebcode
Copy link
Contributor

@sebcode sebcode commented Jan 20, 2019

I store my ControlMaster sockets in ~/.ssh/ due to ControlPath ~/.ssh/%r@%h:%p in my ssh config. While trying to read private key files, Vorta stumbled upon these sockets and crashed on startup:

  File "/Users/seb/.pyenv/versions/3.6.8/lib/python3.6/site-packages/paramiko/pkey.py", line 278, in _read_private_key_file
    with open(filename, "r") as f:
OSError: [Errno 102] Operation not supported on socket: '/Users/seb/.ssh/seb@asdf'

@@ -84,6 +84,8 @@ def get_private_keys():
available_private_keys = []
if os.path.isdir(ssh_folder):
for key in os.listdir(ssh_folder):
if not os.path.isfile(os.path.join(ssh_folder, key)):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is another join() some lines below, so it would be better to just compute it once.

Copy link
Collaborator

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@m3nu m3nu merged commit d3dbd4d into borgbase:master Jan 20, 2019
@m3nu
Copy link
Contributor

m3nu commented Jan 20, 2019

Thanks for handling this case @sebcode!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants