Merge pull request #72343 from ivan/chromium-fix-startup

chromium: do not load .so files from current working directory
This commit is contained in:
Graham Christensen 2019-11-01 08:16:27 +01:00 committed by GitHub
commit 30b10641e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,11 @@ in stdenv.mkDerivation {
export CHROME_DEVEL_SANDBOX="$sandbox/bin/${sandboxExecutableName}"
fi
export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:${libPath}"
'' + lib.optionalString (libPath != "") ''
# To avoid loading .so files from cwd, LD_LIBRARY_PATH here must not
# contain an empty section before or after a colon.
export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}${libPath}"
'' + ''
# libredirect causes chromium to deadlock on startup
export LD_PRELOAD="\$(echo -n "\$LD_PRELOAD" | tr ':' '\n' | grep -v /lib/libredirect\\\\.so$ | tr '\n' ':')"