]> git.eshelyaron.com Git - emacs.git/commitdiff
Protect environment variables with double quotes in Tramp
authorDominique Quatravaux <dominique.quatravaux@epfl.ch>
Thu, 15 Dec 2016 08:37:00 +0000 (09:37 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 15 Dec 2016 08:37:00 +0000 (09:37 +0100)
* 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

index 419dccb47e03ff7913bc1d054e43c9c6556939f2..31ef2efbf20e39ad4d22227a529b9450f1286047 100644 (file)
@@ -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