summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-12 14:59:20 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-12 14:59:20 +0000
commit9241b7b29ce5a79026e7805969754c0c772d129e (patch)
tree464dbf172357e0dd3b2cd47e4d831d2f01fc232e /urpm
parent14a0e609bc2dc9a68882acabf0209cdab202f441 (diff)
downloadurpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar
urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar.gz
urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar.bz2
urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar.xz
urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.zip
Forbid urpmq --use-distrib when non root
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index b9e60087..6f632e4f 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -212,7 +212,13 @@ my %options_spec = (
force => \$options{force},
'skip=s' => \$options{skip},
'root=s' => sub { require File::Spec; $options{root} = File::Spec->rel2abs($_[1]) },
- 'use-distrib=s' => \$options{usedistrib},
+ 'use-distrib=s' => sub {
+ if ($< != 0) {
+ print STDERR N("You need to be root to use --use-distrib"), "\n";
+ exit 1;
+ }
+ $options{usedistrib} = $_[1];
+ },
'parallel=s' => \$options{parallel},
'env=s' => \$options{env},
'nolock' => \$options{nolock},