summaryrefslogtreecommitdiff
path: root/standalone
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2018-04-25 13:40:48 -0400
committerJoey Hess <joeyh@joeyh.name>2018-04-25 13:40:48 -0400
commitdd7ab91f97547a12420af6cb51e5b60c41c074a5 (patch)
tree58cb0b5c7b6cf504aa6ec137c5e596ce35bcd8be /standalone
parent3753c072047b12bbe85d5a8ed964ba19ef70b61d (diff)
runshell: Unset LD_PRELOAD
Preloaded libraries from the host system may not get along with the bundled linker. This was observed by users in termux: ERROR: ld.so: object '/data/data/com.termux/files/usr/lib/libtermux-exec.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. Bad system call But it could also affect more usual systems; the preloaded library might rely on symbols from the host libc that are not available or have the wrong versions in the bundled libc. Unsetting LD_PRELOAD entirely seems safest.
Diffstat (limited to 'standalone')
-rwxr-xr-xstandalone/linux/skel/runshell4
1 files changed, 4 insertions, 0 deletions
diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell
index 4b586d5fdf..dc0a2b64fd 100755
--- a/standalone/linux/skel/runshell
+++ b/standalone/linux/skel/runshell
@@ -121,6 +121,10 @@ export ORIG_LOCPATH
LOCPATH="$base/locales"
export LOCPATH
+# LD_PRELOAD may interact badly with the bundled libc and other libraries,
+# which may have a different subarchitecture than the preloaded library.
+unset LD_PRELOAD
+
# Generate locale definition files for the locales in use,
# using the localedef and locale files from the bundle.
# Currently only utf-8 locales are handled.