summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-12-17 14:55:14 +0100
committerSergey Poznyakoff <gray@gnu.org.ua>2017-12-17 14:55:14 +0100
commit8630d22244b92e80ad52144a4e43ea7b5a542402 (patch)
treece6dca3df60ae025f68ac4a6c7e4694db48b20fd
parent37edbef65e31a597cda1308c5f5341bd55f50bc6 (diff)
downloadslackbuilder-8630d22244b92e80ad52144a4e43ea7b5a542402.tar.gz
slackbuilder-8630d22244b92e80ad52144a4e43ea7b5a542402.tar.bz2
Fix recursive download
* lib/SlackBuild/Archive.pm (add_file): Skip any entries with /./ and /../ in the path name.
-rw-r--r--lib/SlackBuild/Archive.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/SlackBuild/Archive.pm b/lib/SlackBuild/Archive.pm
index 746592b..83001f5 100644
--- a/lib/SlackBuild/Archive.pm
+++ b/lib/SlackBuild/Archive.pm
@@ -37,7 +37,10 @@ sub iterate {
sub add_file {
my $self = shift;
- push @{$self->{_dir}}, File::Spec->no_upwards(map { s{/$}{}; $_ } @_);
+ push @{$self->{_dir}}, map {
+ s{/$}{};
+ File::Spec->no_upwards(basename($_)) ? $_ : ()
+ } @_;
}
sub has_file {

Return to:

Send suggestions and report system problems to the System administrator.