From b311cf9511f08f1a393e21095e362ca8f7e53a05 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 23 May 2012 23:00:36 +0000 Subject: only allow absolute paths and urls as new repositories git-svn-id: svn://tug.org/texlive/trunk@26605 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 30f1a41219e..fdc5badeb47 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -72,6 +72,7 @@ BEGIN { } use Cwd qw/abs_path/; +use File::Spec; use Digest::MD5; use Pod::Usage; use Getopt::Long qw(:config no_autoabbrev permute); @@ -3525,6 +3526,12 @@ sub action_repository { tlwarn("$prg: no repository given (to add)\n"); return; } + # check if it is either url or absolute path + if (($p !~ m!^(http|ftp)://!u) && + !File::Spec->file_name_is_absolute($p)) { + tlwarn("$prg: neither http/ftp URL nor absolute path, no action: $p\n"); + return; + } my $t = shift @ARGV; $t = $p if (!defined($t)); if (defined($repos{$t})) { -- cgit v1.2.3