Merge pull request #16180 from zimbatm/shell-escaping

Escape all shell arguments uniformly
This commit is contained in:
zimbatm
2016-06-19 23:27:52 +01:00
committed by GitHub
9 changed files with 20 additions and 19 deletions
@@ -71,8 +71,6 @@ let
};
};
shellEscape = x: "'${replaceChars ["'"] [("'\\'" + "'")] x}'";
loopForever = "while :; do ${coreutils}/bin/sleep 1; done";
initScript = writeScript "init.sh" (''
@@ -132,7 +130,7 @@ let
-o StrictHostKeyChecking=no \
-i /ssh.key \
-l Administrator \
192.168.0.1 -- ${shellEscape command}
192.168.0.1 -- ${lib.escapeShellArg command}
'') + optionalString (suspendTo != null) ''
${coreutils}/bin/touch /xchg/suspend_now
${loopForever}