mirror of https://github.com/digint/btrbk
btrbk: bugfix: untaint raw backup file list read by "find" command
parent
023004e9cc
commit
899ca92026
7
btrbk
7
btrbk
|
@ -3394,12 +3394,13 @@ MAIN:
|
||||||
|
|
||||||
my @subvol_list;
|
my @subvol_list;
|
||||||
my %child_uuid_list;
|
my %child_uuid_list;
|
||||||
foreach my $file (split("\n", $ret))
|
foreach (split("\n", $ret))
|
||||||
{
|
{
|
||||||
unless($file =~ /^$file_match$/) {
|
unless(/^($file_match)$/) {
|
||||||
DEBUG "Skipping non-parseable file: \"$file\"";
|
DEBUG "Skipping non-parseable file: \"$_\"";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
my $file = $1; # untaint argument
|
||||||
unless($file =~ s/^\Q$droot->{PATH}\E\///) {
|
unless($file =~ s/^\Q$droot->{PATH}\E\///) {
|
||||||
ABORTED($droot, "Unexpected result from 'find': file \"$file\" is not under \"$droot->{PATH}\"");
|
ABORTED($droot, "Unexpected result from 'find': file \"$file\" is not under \"$droot->{PATH}\"");
|
||||||
last;
|
last;
|
||||||
|
|
Loading…
Reference in New Issue