nixos/test: Fix escaping for copyFileFromHost
A long-time issue and one of the reasons I've never used that function before. So let's remove that todo-comment and escape the contents properly. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @edolstra
This commit is contained in:
parent
5231d0ac29
commit
a5e9668c5c
|
@ -607,7 +607,8 @@ sub waitForWindow {
|
||||||
sub copyFileFromHost {
|
sub copyFileFromHost {
|
||||||
my ($self, $from, $to) = @_;
|
my ($self, $from, $to) = @_;
|
||||||
my $s = `cat $from` or die;
|
my $s = `cat $from` or die;
|
||||||
$self->mustSucceed("echo '$s' > $to"); # !!! escaping
|
$s =~ s/'/'\\''/g;
|
||||||
|
$self->mustSucceed("echo '$s' > $to");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue