Commit 64b71fe3 authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug 32: correctly parse 'df' output (untaint values)

parent 113f1e35
......@@ -538,7 +538,7 @@ sub get_mount_info {
return undef if !$out;
my @res = split (/\s+/, $out);
my @res = $out =~ m/^(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%\s+(.*)$/;
return undef if scalar (@res) != 7;
......@@ -552,7 +552,7 @@ sub get_mount_info {
sub get_lvm_device {
my ($dir, $mapping) = @_;
my $info = get_mount_info ($dir);
my $info = get_mount_info($dir);
return undef if !$info;
......@@ -682,7 +682,7 @@ sub exec_backup_task {
$task->{tmpdir} = "$opts->{tmpdir}/vzdumptmp$$";
} else {
# dumpdir is posix? then use it as temporary dir
my $info = get_mount_info ($opts->{dumpdir});
my $info = get_mount_info($opts->{dumpdir});
if ($vmtype eq 'qemu' ||
grep ($_ eq $info->{fstype}, @posix_filesystems)) {
$task->{tmpdir} = "$opts->{dumpdir}/$basename.tmp";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment