2014-03-25 15:45:48 +01:00
|
|
|
Never try to execute the file in ldd
|
|
|
|
|
|
|
|
Executing a random file is never a good idea. Treat all arguments as if
|
|
|
|
they are invoked with __libc_enable_secure, and run them through the known
|
|
|
|
good dynamic linker.
|
|
|
|
|
|
|
|
* elf/ldd.bash.in: Always run through the dynamic linker, even if
|
2016-03-16 13:04:18 +01:00
|
|
|
the file has its own interpreter.
|
2014-03-25 15:45:48 +01:00
|
|
|
|
|
|
|
Index: glibc-2.19/elf/ldd.bash.in
|
|
|
|
===================================================================
|
|
|
|
--- glibc-2.19.orig/elf/ldd.bash.in
|
|
|
|
+++ glibc-2.19/elf/ldd.bash.in
|
2016-03-16 13:04:18 +01:00
|
|
|
@@ -164,18 +164,6 @@ warning: you do not have execution permi
|
2014-03-25 15:45:48 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
case $ret in
|
|
|
|
- 0)
|
|
|
|
- # 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.
|
|
|
|
- try_trace "$file"
|
|
|
|
- rc=$?
|
|
|
|
- if [ $rc = 5 ]; then
|
|
|
|
- try_trace "$RTLD" "$file"
|
|
|
|
- rc=$?
|
|
|
|
- fi
|
|
|
|
- [ $rc = 0 ] || result=1
|
|
|
|
- ;;
|
|
|
|
1)
|
|
|
|
# This can be a non-ELF binary or no binary at all.
|
|
|
|
nonelf "$file" || {
|
2016-03-16 13:04:18 +01:00
|
|
|
@@ -183,7 +171,7 @@ warning: you do not have execution permi
|
2014-03-25 15:45:48 +01:00
|
|
|
result=1
|
|
|
|
}
|
|
|
|
;;
|
|
|
|
- 2)
|
|
|
|
+ [02])
|
|
|
|
try_trace "$RTLD" "$file" || result=1
|
|
|
|
;;
|
|
|
|
*)
|