diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-10 14:07:10 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-10 14:07:10 +0000 |
commit | 30df75df035e1dab1df228ea03e86738e9510f52 (patch) | |
tree | 5b876b693e0f56015af5040d6fa78c2bf148da33 | |
parent | b5ba08b099bf4d2236d50d1d5af8fe4e198041f3 (diff) | |
download | urpmi-30df75df035e1dab1df228ea03e86738e9510f52.tar urpmi-30df75df035e1dab1df228ea03e86738e9510f52.tar.gz urpmi-30df75df035e1dab1df228ea03e86738e9510f52.tar.bz2 urpmi-30df75df035e1dab1df228ea03e86738e9510f52.tar.xz urpmi-30df75df035e1dab1df228ea03e86738e9510f52.zip |
Don't allow media names that begin with -- in urpmi.addmedia and urpmi.update, to avoid naming mistakes
-rw-r--r-- | urpm/args.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/urpm/args.pm b/urpm/args.pm index a6d7275e..c808d8d6 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -265,7 +265,13 @@ my %options_spec = ( 'q|quiet' => sub { --$options{verbose} }, 'v|verbose' => sub { ++$options{verbose} }, 'norebuild!' => sub { $urpm->{options}{norebuild} = $_[1]; $options{force} = 0 }, - '<>' => sub { push @::toupdates, $_[0] }, + '<>' => sub { + my ($p) = @_; + if ($p =~ /^--?(.+)/) { # unrecognized option + die "Unknown option: $1\n"; + } + push @::toupdates, $p; + }, }, 'urpmi.addmedia' => { @@ -282,7 +288,11 @@ my %options_spec = ( 'v|verbose' => sub { ++$options{verbose} }, raw => \$options{raw}, '<>' => sub { - push @::cmdline, $_[0]; + my ($p) = @_; + if ($p =~ /^--?(.+)/) { # unrecognized option + die "Unknown option: $1\n"; + } + push @::cmdline, $p; }, }, |