[openwrt/openwrt] scripts: bundle-libraries.sh: retain preloaded libraries
LEDE Commits
lede-commits at lists.infradead.org
Thu Sep 10 08:25:22 EDT 2020
jow pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/10dbdeccfadb56557d267e3dc8f22d6bafbb422f
commit 10dbdeccfadb56557d267e3dc8f22d6bafbb422f
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Thu Sep 10 13:55:48 2020 +0200
scripts: bundle-libraries.sh: retain preloaded libraries
Since the introduction of fakeroot support, wrapped SDK executables might
be invoked from a shell that has libfakeroot.so preloaded.
Since we're using preloading as well in order to mangle argv[0] when
invoking the shipped ELF interpreter directly, we must take care of
preloading the already preloaded libraries as well, to avoid invoked
programs losing their fakeroot capabilities.
Extend the bundle-libraries.sh script to take any existing $LD_PRELOAD
into account when invoking the target ELF executable with a preloaded
runas.so library.
Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
scripts/bundle-libraries.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/bundle-libraries.sh b/scripts/bundle-libraries.sh
index d3c7206a4d..9efcbbd0b2 100755
--- a/scripts/bundle-libraries.sh
+++ b/scripts/bundle-libraries.sh
@@ -186,7 +186,7 @@ for BIN in "$@"; do
#!/usr/bin/env bash
dir="\$(dirname "\$0")"
export RUNAS_ARG0="\$0"
- export LD_PRELOAD="\$dir/${REL:+$REL/}runas.so"
+ export LD_PRELOAD="\${LD_PRELOAD:+\$LD_PRELOAD:}\$dir/${REL:+$REL/}runas.so"
exec "\$dir/${REL:+$REL/}$LDSO" --library-path "\$dir/${REL:+$REL/}" "\$dir/.${BIN##*/}.bin" "\$@"
EOF
More information about the lede-commits
mailing list