|
From: | Dominique Quatravaux |
Subject: | Re: [PATCH] Guard against random bash bug |
Date: | Wed, 14 Dec 2016 21:32:51 +0000 |
Hmm, I did some tests like this (if you'll pardon the pedestrian style),
(setq tramp-remote-process-environment (setenv-internal tramp-remote-process-environment "TEST1" "''" t))
(setq tramp-remote-process-environment (setenv-internal tramp-remote-process-environment "TEST2" "\"" t))
(setq tramp-remote-process-environment (setenv-internal tramp-remote-process-environment "TEST3" "'" t))
(setq tramp-remote-process-environment (setenv-internal tramp-remote-process-environment "TEST4" "$" t))
(setq tramp-remote-process-environment (setenv-internal tramp-remote-process-environment "TEST5" "' )" t))
(setq tramp-remote-process-environment (setenv-internal tramp-remote-process-environment "TEST6" "!true" t))
and it all came out correctly:
kilimandjaro:~$ env|grep TEST
TEST4=$
TEST1=''
TEST6=!true
TEST2="
TEST3='
TEST5=' )
I seem to remember from "man bash" that double quotes protect against word splits (which happen fairly late themselves), and that variable expansions are not recursive.
(Although your code does work, too so really it's up to you)
—
Dominique Quatravaux
Responsable informatique STI EPFL +41 21 69 35624 |
[Prev in Thread] | Current Thread | [Next in Thread] |