Skip to content

Commit

Permalink
Merge pull request #1553 from dmach/fix-sshkey-expanduser
Browse files Browse the repository at this point in the history
Always expand '~' in sshkey path
  • Loading branch information
dmach authored Apr 30, 2024
2 parents f908092 + 7fb6234 commit cea3387
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 cea3387

Please sign in to comment.