summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-01-22 17:02:00 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-01-22 17:02:00 +0100
commitec60a064cdd8a2eec93f0d1312209f42aca88e38 (patch)
tree268724626b58c232aaa69b45e0a046054cd6bcb7
parentd96f1f181d99da6cdab18bf22fe2ed70d73b81d3 (diff)
downloadbin-ec60a064cdd8a2eec93f0d1312209f42aca88e38.tar.gz
bin-ec60a064cdd8a2eec93f0d1312209f42aca88e38.tar.xz
borg-restore.pl: Use taint mode with DBI
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xborg-restore.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/borg-restore.pl b/borg-restore.pl
index b16a0d2..04385c2 100755
--- a/borg-restore.pl
+++ b/borg-restore.pl
@@ -598,7 +598,7 @@ sub _open_db {
my $self = shift;
my $dbfile = shift;
- $self->{dbh} = DBI->connect("dbi:SQLite:dbname=$dbfile","","", {RaiseError => 1});
+ $self->{dbh} = DBI->connect("dbi:SQLite:dbname=$dbfile","","", {RaiseError => 1, Taint => 1});
$self->{dbh}->do("PRAGMA cache_size=-1024000");
$self->{dbh}->do("PRAGMA strict=ON");
}
@@ -708,7 +708,7 @@ sub get_archives_for_path {
my $path = shift;
my $st = $self->{dbh}->prepare('select * from `files` where `path` = ?;');
- $st->execute($path);
+ $st->execute(untaint($path, qr(.*)));
my @ret;