summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-13 05:12:19 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-13 05:12:19 +0000
commit2251687c07d6f102a481f4cd3427091d278b8705 (patch)
tree90e9321c55cd57b6c993dbb52089ed5eba190262
parent567cb34ec5da9e2298da89b6a4aff2ee9d35ceb6 (diff)
downloadurpmi-2251687c07d6f102a481f4cd3427091d278b8705.tar
urpmi-2251687c07d6f102a481f4cd3427091d278b8705.tar.gz
urpmi-2251687c07d6f102a481f4cd3427091d278b8705.tar.bz2
urpmi-2251687c07d6f102a481f4cd3427091d278b8705.tar.xz
urpmi-2251687c07d6f102a481f4cd3427091d278b8705.zip
More checks for root capabilities
-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'};