Skip to content

Commit 505d664

Browse files
authored
Merge pull request #532 from nix-community/fix-kexec
quote kexec command before running it.
2 parents e730c02 + bfcf95f commit 505d664

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nixos-anywhere.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,13 +657,13 @@ TMPDIR=/root/kexec setsid sudo /root/kexec/kexec/run --kexec-extra-flags \"$kexe
657657
658658
remoteCommands=${remoteCommandTemplate//'%TAR_COMMAND%'/$tarCommand}
659659
660-
runSsh sh -c "$remoteCommands"
660+
runSsh sh -c "$(printf '%q' "$remoteCommands")"
661661
else
662662
# Use local command with pipe to remote
663663
tarCommand="${maybeSudo} tar -C /root/kexec -xvzf-"
664664
remoteCommands=${remoteCommandTemplate//'%TAR_COMMAND%'/$tarCommand}
665665
666-
"${localUploadCommand[@]}" | runSsh sh -c "$remoteCommands"
666+
"${localUploadCommand[@]}" | runSsh sh -c "$(printf '%q' "$remoteCommands")"
667667
fi
668668
669669
# use the default SSH port to connect at this point

0 commit comments

Comments
 (0)