mirror of https://github.com/digint/btrbk
btrbk: sanitize url on PRINT
For consistency with PATH and URL, $vol->{PRINT} was not sanitized (trailing "//" if parent is "/"). This is now dropped, as this is more confusing than useful.pull/334/head
parent
936f88a68f
commit
c11ab1507d
8
btrbk
8
btrbk
|
@ -2446,9 +2446,10 @@ sub vinfo($$)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Note that PATH and URL have no trailing slash, except if "/".
|
||||||
return {
|
return {
|
||||||
HOST => $host, # hostname|<undef>
|
HOST => $host, # hostname|<undef>
|
||||||
PORT => $port, # port|<undef>
|
PORT => $port, # port|<undef>
|
||||||
NAME => $name,
|
NAME => $name,
|
||||||
PATH => $path,
|
PATH => $path,
|
||||||
PRINT => $print,
|
PRINT => $print,
|
||||||
|
@ -2470,13 +2471,12 @@ sub vinfo_child($$;$)
|
||||||
$subvol_dir = $1 if($name =~ s/^(.*)\///);
|
$subvol_dir = $1 if($name =~ s/^(.*)\///);
|
||||||
|
|
||||||
# Note that PATH and URL intentionally contain "//" if $parent->{PATH} = "/".
|
# Note that PATH and URL intentionally contain "//" if $parent->{PATH} = "/".
|
||||||
# For consistency reasons (not required), we dont sanitize PRINT either.
|
|
||||||
my $vinfo = {
|
my $vinfo = {
|
||||||
HOST => $parent->{HOST},
|
HOST => $parent->{HOST},
|
||||||
PORT => $parent->{PORT},
|
PORT => $parent->{PORT},
|
||||||
NAME => $name,
|
NAME => $name,
|
||||||
PATH => "$parent->{PATH}/$rel_path",
|
PATH => "$parent->{PATH}/$rel_path",
|
||||||
PRINT => "$parent->{PRINT}/$rel_path",
|
PRINT => "$parent->{PRINT}" . ($parent->{PRINT} =~ /\/$/ ? "" : "/") . $rel_path,
|
||||||
URL => "$parent->{URL}/$rel_path",
|
URL => "$parent->{URL}/$rel_path",
|
||||||
URL_PREFIX => $parent->{URL_PREFIX},
|
URL_PREFIX => $parent->{URL_PREFIX},
|
||||||
MACHINE_ID => $parent->{MACHINE_ID},
|
MACHINE_ID => $parent->{MACHINE_ID},
|
||||||
|
|
Loading…
Reference in New Issue