mirror of https://github.com/digint/btrbk
btrbk: bugfix: untaint result of system_realpath()
parent
407d25f604
commit
86170e6b21
7
btrbk
7
btrbk
|
@ -1129,12 +1129,13 @@ sub system_realpath($)
|
|||
);
|
||||
return undef unless(defined($ret));
|
||||
|
||||
unless($ret =~ /^$file_match$/) {
|
||||
unless($ret =~ /^($file_match)$/) {
|
||||
ERROR "Failed to parse output of `realpath` for \"$vol->{PRINT}\": \"$ret\"";
|
||||
return undef;
|
||||
}
|
||||
DEBUG "Real path for \"$vol->{PRINT}\" is: $ret";
|
||||
return $ret;
|
||||
my $realpath = $1; # untaint argument
|
||||
DEBUG "Real path for \"$vol->{PRINT}\" is: $realpath";
|
||||
return $realpath;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue