btrbk: fix btr_tree for subvolumes containing special (unsafe) characters

Note that any action (e.g. btrfs send -p) on a subvolume with unsafe
characters will still fail with:

    ERROR: Unsafe command [...] (offending string: "/tmp/btrfs_pool/svol with spaces")
pull/293/head
Axel Burri 2019-07-31 13:44:26 +02:00
parent 10b826b5f3
commit 7d656540d7
1 changed files with 1 additions and 1 deletions

2
btrbk
View File

@ -2278,7 +2278,7 @@ sub btr_tree($$$$)
# "path" always starts with set REL_PATH
my $rel_path = $node->{path};
unless($top_level->{is_root}) {
die unless($rel_path =~ s/^$top_level->{path}\///);
die unless($rel_path =~ s/^\Q$top_level->{path}\E\///);
}
$node->{REL_PATH} = $rel_path; # relative to {TOP_LEVEL}->{path}
}