Skip to content

Commit

Permalink
Always expand '~' in sshkey path
Browse files Browse the repository at this point in the history
  • Loading branch information
dmach committed Apr 29, 2024
1 parent f908092 commit 7fb6234
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ def guess_keyfile(self):
def ssh_sign(self, data, namespace, keyfile=None):
if not keyfile:
keyfile = self.guess_keyfile()
if not keyfile:
raise oscerr.OscIOError(None, "No SSH key configured or auto-detected")
keyfile = os.path.expanduser(keyfile)
cmd = [self.ssh_keygen_path, '-Y', 'sign', '-f', keyfile, '-n', namespace, '-q']
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, encoding="utf-8")
signature, _ = proc.communicate(data)
Expand Down

0 comments on commit 7fb6234

Please sign in to comment.