diff options
Diffstat (limited to 'borg-restore.pl')
-rwxr-xr-x | borg-restore.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/borg-restore.pl b/borg-restore.pl index 5479ba4..5ac2682 100755 --- a/borg-restore.pl +++ b/borg-restore.pl @@ -256,6 +256,7 @@ sub restore { $destination = untaint($destination, qr(.*)); $path = untaint($path, qr(.*)); + my $archive_name = untaint($archive->{archive}, qr([a-zA-Z0-9-]+)); printf "Restoring %s to %s from archive %s\n", $path, $destination, $archive->{archive}; @@ -271,7 +272,7 @@ sub restore { $final_destination = untaint($final_destination, qr(.*)); debug("Removing ".$final_destination); File::Path::remove_tree($final_destination); - system(qw(borg extract -v --strip-components), $components_to_strip, "::".$archive->{archive}, $path); + system(qw(borg extract -v --strip-components), $components_to_strip, "::".$archive_name, $path); } sub get_cache_dir { |