From d381db25a201fa67b7e274a758d6a7c2c350067e Mon Sep 17 00:00:00 2001 From: Dominique Quatravaux Date: Thu, 15 Dec 2016 09:37:00 +0100 Subject: [PATCH] Protect environment variables with double quotes in Tramp * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Protect environment variables with double quotes. Copyright-paperwork-exempt: yes --- lisp/net/tramp-sh.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 419dccb47e0..31ef2efbf20 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4201,10 +4201,11 @@ process to set up. VEC specifies the connection." (when vars (tramp-send-command vec - (format "while read var val; do export $var=$val; done <<'%s'\n%s\n%s" - tramp-end-of-heredoc - (mapconcat 'identity vars "\n") - tramp-end-of-heredoc) + (format + "while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s" + tramp-end-of-heredoc + (mapconcat 'identity vars "\n") + tramp-end-of-heredoc) t)) (when unset (tramp-send-command -- 2.39.2