summaryrefslogtreecommitdiffstats
path: root/rurpme
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-06-13 13:08:23 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-06-13 13:08:23 +0000
commit0d769b1d2ec99e74d044b6acb409a116746eca4c (patch)
tree97240c4635e4f813443ba2475bca467a4894a6a7 /rurpme
parentd43080a88e26c841b3a1215aacb4666c11e797a3 (diff)
downloadurpmi-0d769b1d2ec99e74d044b6acb409a116746eca4c.tar
urpmi-0d769b1d2ec99e74d044b6acb409a116746eca4c.tar.gz
urpmi-0d769b1d2ec99e74d044b6acb409a116746eca4c.tar.bz2
urpmi-0d769b1d2ec99e74d044b6acb409a116746eca4c.tar.xz
urpmi-0d769b1d2ec99e74d044b6acb409a116746eca4c.zip
Add the rurpme(8) command
Diffstat (limited to 'rurpme')
-rw-r--r--rurpme19
1 files changed, 19 insertions, 0 deletions
diff --git a/rurpme b/rurpme
new file mode 100644
index 00000000..ce5a2790
--- /dev/null
+++ b/rurpme
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -T
+
+#- Copyright (C) 2005 Mandriva SA
+
+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 urpme in restricted mode..."), "\n";
+@ARGV or @ARGV = qw(--help);
+exec '/usr/bin/perl', '/usr/sbin/urpme', '--restricted', map { untaint $_ } @ARGV;