summaryrefslogtreecommitdiff
path: root/net-misc/keychain/files/keychain-2.9.8-empty-ssh-askpass.patch
blob: 8b7cade369c103a2d9c12e320c4f053aaf7589f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
rebased from
https://salsa.debian.org/debian/keychain/-/blob/debian/master/debian/patches/empty-ssh-askpass.patch
Description: Handle an empty (or unset) SSH_ASKPASS variable
Bug-Debian: https://bugs.debian.org/325644
--- a/keychain.sh
+++ b/keychain.sh
@@ -1076,6 +1076,9 @@ load_ssh_keys() {
 	IFS="$IFS_BAK"
 	[ $# -eq 0 ] && return
 	mesg "Adding ${CYANN}$#${OFF} ssh key(s): ${CYANN}$*${OFF}"
+	if [ -z "$SSH_ASKPASS" ]; then
+		SSH_ASKPASS="$(command -v ssh-askpass || true)"
+	fi
 	if $noguiopt || [ -z "$SSH_ASKPASS" ] || [ -z "$DISPLAY" ]; then
 		unset DISPLAY		# DISPLAY="" can cause problems
 		unset SSH_ASKPASS	# make sure ssh-add doesn't try SSH_ASKPASS