summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xurpmi.addmedia3
-rwxr-xr-xurpmi.removemedia6
-rwxr-xr-xurpmi.update3
3 files changed, 11 insertions, 1 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 735879c9..d02e47fb 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -105,6 +105,9 @@ sub main {
$options{distrib} or $url or ($url, $name) = ($name, '');
my ($type) = $url =~ m,^([^:]*)://, or $options{distrib} or usage;
+ if ($< != 0) {
+ $urpm->{fatal}(1, N("Only superuser is allowed to add media"));
+ }
$urpm->read_config;
exists $options{limit_rate} or $options{limit_rate} = $urpm->{options}{'limit-rate'};
diff --git a/urpmi.removemedia b/urpmi.removemedia
index db586211..97fad3d9 100755
--- a/urpmi.removemedia
+++ b/urpmi.removemedia
@@ -43,7 +43,11 @@ where <name> is a medium name to remove.
push @toremoves, $_;
}
- my $urpm = new urpm; $urpm->read_config;
+ my $urpm = new urpm;
+ if ($< != 0) {
+ $urpm->{fatal}(1, N("Only superuser is allowed to remove media"));
+ }
+ $urpm->read_config;
my @entries = map { $_->{name} } @{$urpm->{media}};
if ($options{all}) {
diff --git a/urpmi.update b/urpmi.update
index 9e7d2515..329a8f3f 100755
--- a/urpmi.update
+++ b/urpmi.update
@@ -54,6 +54,9 @@ sub main {
urpm::args::parse_cmdline(urpm => $urpm);
+ if ($< != 0) {
+ $urpm->{fatal}(1, N("Only superuser is allowed to update media"));
+ }
$urpm->read_config;
exists $options{limit_rate} or $options{limit_rate} = $urpm->{options}{'limit-rate'};