mirror of https://github.com/digint/btrbk
btrbk: allow directory traversal for subvol_args
parent
a25486336b
commit
047d3a1a65
7
btrbk
7
btrbk
|
@ -33,6 +33,7 @@ use Getopt::Long qw(GetOptions);
|
|||
use Time::Local qw( timelocal timegm timegm_nocheck );
|
||||
use IPC::Open3 qw(open3);
|
||||
use Symbol qw(gensym);
|
||||
use Cwd qw(abs_path);
|
||||
|
||||
our $VERSION = '0.32.1-dev';
|
||||
our $AUTHOR = 'Axel Burri <axel@tty0.ch>';
|
||||
|
@ -5586,11 +5587,7 @@ MAIN:
|
|||
foreach (@subvol_args) {
|
||||
my ($url_prefix, $path) = check_url($_);
|
||||
if(!defined($path) && $subvol_args_allow_relative && ($url_prefix eq "") && (-d $_)) {
|
||||
unless(eval_quiet { require File::Spec; }) {
|
||||
ERROR "Cannot handle relative paths (perl version too old; missing File::Spec module): $_";
|
||||
exit 2;
|
||||
}
|
||||
$path = check_file(File::Spec->rel2abs($_), { absolute => 1 });
|
||||
$path = check_file(abs_path($_), { absolute => 1, sanitize => 1 });
|
||||
}
|
||||
unless(defined($path)) {
|
||||
ERROR "Bad argument: not a subvolume declaration: $_";
|
||||
|
|
Loading…
Reference in New Issue