diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-12-08 10:57:20 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-12-08 10:57:20 +0000 |
commit | fd74fc86fddfd1dbf64904a64d026d37c032c0ba (patch) | |
tree | b9e3741cc509cf076bd2d4f159bb8a6e7f3d1f5c /elf/ldd.bash.in | |
parent | ff4eb01a424875d6ff9183c4f4f42d17743fee77 (diff) |
* elf/ldd.bash.in: For -u, set bind_now=yes.cvs/fedora-glibc-2_3_3-89
If eval $add_env '"$file"' exits with exitcode 5, retry with
eval $add_env \${RTLD} '"$file"'.
Remove | cat usage, it breaks exit code propagation.
* elf/rtld.c (process_envvars): If __libc_enable_secure and
mode != normal, exit with exitcode 5.
Diffstat (limited to 'elf/ldd.bash.in')
-rw-r--r-- | elf/ldd.bash.in | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in index f400924217..c91886a1e6 100644 --- a/elf/ldd.bash.in +++ b/elf/ldd.bash.in @@ -74,6 +74,7 @@ For bug reporting instructions, please see: ;; -u | --u | --un | --unu | --unus | --unuse | --unused) unused=yes + bind_now=yes shift ;; --v | --ve | --ver) @@ -153,7 +154,11 @@ warning: you do not have execution permission for" "\`$file'" >&2 fi case $ret in 0) - eval $add_env '"$file"' || result=1 + # If the program exits with exit code 5, it means the process has been + # invoked with __libc_enable_secure. Fall back to running it through + # the dynamic linker. + ( eval $add_env '"$file"'; ret=$?; [ $ret != 5 ] && exit $ret; + eval $add_env \${RTLD} '"$file"'; ) || result=1 ;; 1) # This can be a non-ELF binary or no binary at all. @@ -163,10 +168,7 @@ warning: you do not have execution permission for" "\`$file'" >&2 } ;; 2) - # The following use of cat is needed to make ldd work in SELinux - # environments where the executed program might not have permissions - # to write to the console/tty. - eval $add_env \${RTLD} '"$file"' | cat || result=1 + eval $add_env \${RTLD} '"$file"' || result=1 ;; *) echo 'ldd:' ${RTLD} $"exited with unknown exit code" "($ret)" >&2 |