mirror of https://github.com/digint/btrbk
btrbk: add sanity checks on mountinfo list
parent
2556492ec6
commit
063c25ad24
9
btrbk
9
btrbk
|
@ -1940,6 +1940,10 @@ sub system_list_mountinfo($)
|
|||
non_destructive => 1,
|
||||
);
|
||||
return undef unless(defined($ret));
|
||||
unless(@$ret) {
|
||||
ERROR "Failed to parse \"$vol->{URL_PREFIX}$file\": no output";
|
||||
return undef;
|
||||
}
|
||||
|
||||
my @mountinfo;
|
||||
foreach(@$ret)
|
||||
|
@ -1964,6 +1968,11 @@ sub system_list_mountinfo($)
|
|||
}
|
||||
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.
|
||||
my %mntops;
|
||||
foreach (split(',', delete($line{super_options})),
|
||||
|
|
Loading…
Reference in New Issue