summaryrefslogtreecommitdiffstats
path: root/rurpme
blob: ac55c0f1cdaea0288e15298777edcdbff6786cc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -T
# vim:et:ai:ts=4:sts=4:sw=4

#- Copyright (C) 2005-2010 Mandriva SA
#- Copyright (C) 2011-2020 Mageia

use strict;
use urpm::msg;
use urpm::util qw(untaint);

if ($< != 0) {
    print STDERR N("Only superuser is allowed to uninstall packages"), "\n";
    exit 1;
}

$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin";
delete @ENV{qw(ENV BASH_ENV HOME IFS CDPATH PERLLIB PERL5LIB PERL5OPT PERLIO PERLIO_DEBUG PERL5DB PERL_ENCODING PERL_HASH_SEED PERL_SIGNALS PERL_UNICODE RPM_CONFIGDIR)};

print STDERR N("Running urpme in restricted mode..."), "\n";
@ARGV or @ARGV = qw(--help);
exec '/usr/bin/perl', '/usr/sbin/urpme', '--restricted', map { untaint $_ } @ARGV;