use file_copy instead of an unsafe cp call

This commit is contained in:
Wolfgang Bumiller 2016-08-16 16:31:12 +02:00 committed by Fabian Grünbichler
parent 5089350947
commit b800197970

View File

@ -222,11 +222,11 @@ sub assemble {
$task->{cleanup}->{etc_vzdump} = 1;
mkpath "$dir/etc/vzdump/";
$self->cmd ("cp '$conffile' '$dir/etc/vzdump/vps.conf'");
PVE::Tools::file_copy($conffile, "$dir/etc/vzdump/vps.conf");
my $cfgdir = dirname ($conffile);
foreach my $s (PVE::OpenVZ::SCRIPT_EXT) {
my $fn = "$cfgdir/$vmid.$s";
$self->cmd ("cp '$fn' '$dir/etc/vzdump/vps.$s'") if -f $fn;
PVE::Tools::file_copy($fn, "$dir/etc/vzdump/vps.$s") if -f $fn;
}
}