tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Guard against random bash bug


From: Dominique Quatravaux
Subject: [PATCH] Guard against random bash bug
Date: Tue, 13 Dec 2016 12:06:32 +0000

It turns out that when a="Foo Bar",

  export b=$a

does what we want, but

  export $b=$a

doesn't, regardless of the value of b.
---
lisp/tramp-sh.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 419dccb..b45cf29 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -4201,7 +4201,7 @@ 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"
+        (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)
-- 
2.6.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]