From ed91e0f2f33e231eefce44217969aa34c3a26502 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 31 Aug 2022 17:17:33 -0400 Subject: [PATCH] Have askpass delete itself This causes ssh-add to give up, instead of endlessly rerunning the askpass script. --- confluent_server/confluent/sshutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/sshutil.py b/confluent_server/confluent/sshutil.py index c6bb1753..13457d1d 100644 --- a/confluent_server/confluent/sshutil.py +++ b/confluent_server/confluent/sshutil.py @@ -125,7 +125,7 @@ def prep_ssh_key(keyname): try: askpass = os.path.join(tmpdir, 'askpass.sh') with open(askpass, 'w') as ap: - ap.write('#!/bin/sh\necho $CONFLUENT_SSH_PASSPHRASE\n') + ap.write('#!/bin/sh\necho $CONFLUENT_SSH_PASSPHRASE\n;rm {0}\n'.format(askpass)) os.chmod(askpass, 0o700) os.environ['CONFLUENT_SSH_PASSPHRASE'] = get_passphrase() os.environ['DISPLAY'] = 'NONE'