vm/windows: Properly escape shell command.
Security-wise it's not a big issue because we're still sandboxed, but I really don't want to write something like \\\\\\\\192.168.0.2\\\\share in order to set up network shares. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
cfa859d792
commit
aa65a7057f
|
@ -57,6 +57,8 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
shellEscape = x: "'${lib.replaceChars ["'"] [("'\\'" + "'")] x}'";
|
||||
|
||||
initScript = writeScript "init.sh" (''
|
||||
#!${stdenv.shell}
|
||||
${coreutils}/bin/mkdir -p /etc/samba /etc/samba/private /var/lib/samba
|
||||
|
@ -104,7 +106,7 @@ let
|
|||
-o StrictHostKeyChecking=no \
|
||||
-i /ssh.key \
|
||||
-l Administrator \
|
||||
192.168.0.1 -- "${command}"
|
||||
192.168.0.1 -- ${shellEscape command}
|
||||
|
||||
${busybox}/sbin/poweroff -f
|
||||
''));
|
||||
|
|
Loading…
Reference in a new issue