summaryrefslogtreecommitdiffstats
path: root/rurpmi
blob: ba31c9d77f4f3aba818b7d771d4fa20a67e4ec88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl -T

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

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

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

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