btrbk: bugfix: check path when expanding wildcards (warn and ignore if check fails)

Before this patch, btrbk errored (unsafe command), and then died.
Fixes #181.
pull/147/merge
Axel Burri 2017-09-11 18:49:14 +02:00
parent d265c34149
commit f113436626
2 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@ btrbk-current
* Remove "duration" column from transaction_log/transaction_syslog.
* Bugfix: ssh_filter_btrbk: accept mbuffer command (stream_buffer).
* Bugfix: print correct (end-)time in transaction_log.
* Bugfix: check path when expanding wildcards (close #181).
btrbk-0.25.1

4
btrbk
View File

@ -4283,6 +4283,10 @@ MAIN:
TRACE "skipping non-matching subvolume: $vol->{PRINT}";
next;
}
unless(defined(check_file($vol->{SUBVOL_PATH}, { relative => 1 }))) {
WARN "Ambiguous subvolume path \"$vol->{SUBVOL_PATH}\" while expanding \"$globs\", ignoring";
next;
}
INFO "Found source subvolume: $vol->{PRINT}";
my %conf = ( %$config_subvol,
rel_path_glob => $globs,