btrbk: add sanity checks on mountinfo list

pull/427/head
Axel Burri 2021-08-17 18:39:59 +02:00
parent 2556492ec6
commit 063c25ad24
1 changed files with 9 additions and 0 deletions

9
btrbk
View File

@ -1940,6 +1940,10 @@ sub system_list_mountinfo($)
non_destructive => 1, non_destructive => 1,
); );
return undef unless(defined($ret)); return undef unless(defined($ret));
unless(@$ret) {
ERROR "Failed to parse \"$vol->{URL_PREFIX}$file\": no output";
return undef;
}
my @mountinfo; my @mountinfo;
foreach(@$ret) foreach(@$ret)
@ -1964,6 +1968,11 @@ sub system_list_mountinfo($)
} }
my %line = %+; my %line = %+;
unless(defined(check_file($line{mount_point}, { absolute => 1 }))) {
ERROR "Ambiguous mount point in \"$vol->{URL_PREFIX}$file\": $line{mount_point}";
return undef;
}
# merge super_options and mount_options to MNTOPS. # merge super_options and mount_options to MNTOPS.
my %mntops; my %mntops;
foreach (split(',', delete($line{super_options})), foreach (split(',', delete($line{super_options})),