diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-12-14 10:23:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-12-14 10:23:16 +0000 |
commit | 2f287b8c7ac8766071a6e2cbe0dcfb75f07386f9 (patch) | |
tree | f1e7307691ac6bfc71051058c6b5017dfa633d4e /perl-install/run_program.pm | |
parent | 9fb537f048f02d580f90b47cf9b6659b05847f02 (diff) | |
download | drakx-2f287b8c7ac8766071a6e2cbe0dcfb75f07386f9.tar drakx-2f287b8c7ac8766071a6e2cbe0dcfb75f07386f9.tar.gz drakx-2f287b8c7ac8766071a6e2cbe0dcfb75f07386f9.tar.bz2 drakx-2f287b8c7ac8766071a6e2cbe0dcfb75f07386f9.tar.xz drakx-2f287b8c7ac8766071a6e2cbe0dcfb75f07386f9.zip |
fix handling absolute binary in chroot
(and add some comment about the usefulness of catching program not found early)
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r-- | perl-install/run_program.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index c6eb456b8..042f4883e 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -62,8 +62,11 @@ sub raw { my $stdout = $stdout_raw && (ref($stdout_raw) ? $tmpdir->() . "/.drakx-stdout.$$" : "$root$stdout_raw"); my $stderr = $stderr_raw && (ref($stderr_raw) ? $tmpdir->() . "/.drakx-stderr.$$" : "$root$stderr_raw"); - my ($rname) = split(/[ \|]/, $real_name, 2); - if (! ($rname =~ m!^/! ? -x $rname : whereis_binary($rname, $root))) { + #- checking if binary exist to avoid cloberring stdout file + my ($rname) = $real_name =~ /(.*)[\s\|]/; + if (! ($rname =~ m!^/! + ? -x "$root$rname" || $root && -l "$root$rname" #- handle non-relative symlink which can be broken when non-rooted + : whereis_binary($rname, $root))) { log::l("program not found: $real_name"); return; } |