summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/App/BorgRestore/Helper.pm2
-rw-r--r--t/01_untaint.t1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/App/BorgRestore/Helper.pm b/lib/App/BorgRestore/Helper.pm
index b4d52e5..8403ec3 100644
--- a/lib/App/BorgRestore/Helper.pm
+++ b/lib/App/BorgRestore/Helper.pm
@@ -14,7 +14,7 @@ sub untaint {
sub untaint_archive_name {
my $archive = shift;
- return untaint($archive, qr([a-zA-Z0-9-:+]+));
+ return untaint($archive, qr([a-zA-Z0-9-:+\.]+));
}
1;
diff --git a/t/01_untaint.t b/t/01_untaint.t
index 9d2fde1..f9d8a9c 100644
--- a/t/01_untaint.t
+++ b/t/01_untaint.t
@@ -8,6 +8,7 @@ use App::BorgRestore::Helper;
ok(App::BorgRestore::Helper::untaint_archive_name('abc-1234:5+1') eq 'abc-1234:5+1');
ok(App::BorgRestore::Helper::untaint_archive_name('abc') eq 'abc');
+ok(App::BorgRestore::Helper::untaint_archive_name('root-2016-09-30T15+02:00.checkpoint') eq 'root-2016-09-30T15+02:00.checkpoint');
dies_ok(sub{App::BorgRestore::Helper::untaint_archive_name('abc`"\'')}, 'special chars not allowed');
dies_ok(sub{App::BorgRestore::Helper::untaint_archive_name('abc`')}, 'special chars not allowed');