From 909ef69e5e67415b293a88734eb6dd82281cc683 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Mon, 26 Jul 2021 15:49:50 +0900 Subject: [PATCH] include/ssh: Make sure handles don't contain line breaks Handles returned by ssh_tunnel_open() and ssh_proxy_open() are base64 encoded using the base64 commandline tool. However, base64 inserts line breaks into long outputs, causing line breaks to be inserted into long handles, and the returned handles to become unusable. This commit changes the parameters passed tp base64 so that no line breaks are inserted into the handles. --- include/ssh.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ssh.sh b/include/ssh.sh index 36d7696..a1634ad 100755 --- a/include/ssh.sh +++ b/include/ssh.sh @@ -77,13 +77,13 @@ _ssh_make_handle() { local handle - if ! handle=$(base64 <<< "$ctrlsock" 2>/dev/null); then + if ! handle=$(base64 -w 0 <<< "$ctrlsock" 2>/dev/null); then return 1 fi handle+=":" - if ! handle+=$(base64 <<< "$hostspec" 2>/dev/null); then + if ! handle+=$(base64 -w 0 <<< "$hostspec" 2>/dev/null); then return 1 fi -- 2.47.3