From 2251687c07d6f102a481f4cd3427091d278b8705 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 13 Jul 2004 05:12:19 +0000 Subject: More checks for root capabilities --- urpmi.removemedia | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'urpmi.removemedia') diff --git a/urpmi.removemedia b/urpmi.removemedia index db586211..97fad3d9 100755 --- a/urpmi.removemedia +++ b/urpmi.removemedia @@ -43,7 +43,11 @@ where 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}) { -- cgit v1.2.1