diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:52:17 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:52:17 +0000 |
commit | d976891fe38a82a8aa6e0fb6a5c5bb40bab1a18e (patch) | |
tree | ce78696ac34e280e8393b381cdd87955d8ee4775 | |
parent | 1734ec1d100bcc65a7e80c0c93285738365a9ae8 (diff) | |
download | urpmi-d976891fe38a82a8aa6e0fb6a5c5bb40bab1a18e.tar urpmi-d976891fe38a82a8aa6e0fb6a5c5bb40bab1a18e.tar.gz urpmi-d976891fe38a82a8aa6e0fb6a5c5bb40bab1a18e.tar.bz2 urpmi-d976891fe38a82a8aa6e0fb6a5c5bb40bab1a18e.tar.xz urpmi-d976891fe38a82a8aa6e0fb6a5c5bb40bab1a18e.zip |
drop /usr/X11R6/bin from $PATH
-rwxr-xr-x | gurpmi | 2 | ||||
-rwxr-xr-x | gurpmi2 | 2 | ||||
-rw-r--r-- | rurpme | 2 | ||||
-rw-r--r-- | rurpmi | 2 | ||||
-rw-r--r-- | urpm/download.pm | 6 | ||||
-rwxr-xr-x | urpme | 2 | ||||
-rwxr-xr-x | urpmi | 6 | ||||
-rwxr-xr-x | urpmi.addmedia | 2 | ||||
-rw-r--r-- | urpmi.recover | 2 | ||||
-rwxr-xr-x | urpmi.removemedia | 2 | ||||
-rwxr-xr-x | urpmi.update | 2 |
11 files changed, 17 insertions, 13 deletions
@@ -6,7 +6,7 @@ use strict; BEGIN { #- set up a safe path and environment - $ENV{PATH} = "/bin:/usr/bin:/usr/X11R6/bin"; + $ENV{PATH} = "/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; } @@ -6,7 +6,7 @@ use strict; BEGIN { #- set up a safe path and environment - $ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; + $ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; } @@ -11,7 +11,7 @@ if ($< != 0) { exit 1; } -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$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"; @@ -12,7 +12,7 @@ if ($< != 0) { exit 1; } -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$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 urpmi in restricted mode..."), "\n"; diff --git a/urpm/download.pm b/urpm/download.pm index 18c63f42..97187270 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -886,7 +886,11 @@ sub sync_rel { my @result_files = map { $all_options->{dir} . '/' . basename($_) } @$rel_files; unlink @result_files if $all_options->{preclean}; - if (eval { _sync_webfetch_raw($urpm, $medium, $rel_files, \@files, $all_options); 1 }) { + (my $cwd) = getcwd() =~ /(.*)/; + eval { _sync_webfetch_raw($urpm, $medium, $rel_files, \@files, $all_options) }; + my $err = $@; + chdir $cwd; + if (!$err) { $urpm->{log}(N("retrieved %s", $files_text)); \@result_files; } else { @@ -29,7 +29,7 @@ use urpm::select; use urpm::orphans; -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; our ($test, $parallel, $force, $env); @@ -57,7 +57,7 @@ my @src_files; my @names; my @src_names; -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; $ENV{HOME} ||= "/root"; $ENV{USER} ||= "root"; @@ -637,8 +637,8 @@ my $exit_code = urpm::main_loop::run($urpm, $state, my $msg = N("Please insert the medium named \"%s\"", $_[0]); if ($ENV{DISPLAY} && $::gui) { #- probably run from a drak tool - (my $gmessage) = find { -x $_ } '/usr/X11R6/bin/gmessage', '/usr/bin/gmessage'; - if ($gmessage) { + my $gmessage = '/usr/bin/gmessage'; + if (-x $gmessage) { return system($gmessage, '-buttons', N("Ok") . ':1,' . N("Cancel") . ':0', "\n$msg\n"); } } diff --git a/urpmi.addmedia b/urpmi.addmedia index 1529b5d4..1982d62d 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -86,7 +86,7 @@ and [options] are from exit 1; } -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; $options{force} = 0; diff --git a/urpmi.recover b/urpmi.recover index 1e4f73bb..8f806838 100644 --- a/urpmi.recover +++ b/urpmi.recover @@ -8,7 +8,7 @@ use strict; BEGIN { #- clean environment - $ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; + $ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; } diff --git a/urpmi.removemedia b/urpmi.removemedia index 8c7375fd..b5696474 100755 --- a/urpmi.removemedia +++ b/urpmi.removemedia @@ -28,7 +28,7 @@ use urpm::download; use urpm::media; use urpm::args; -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; my @toremove; diff --git a/urpmi.update b/urpmi.update index dba14159..6eaa45b3 100755 --- a/urpmi.update +++ b/urpmi.update @@ -56,7 +56,7 @@ where <name> is a medium name to update. exit 1; } -$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; +$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin"; delete @ENV{qw(ENV BASH_ENV IFS CDPATH)}; our @cmdline; #- set by urpm::args |