commit a0420227e3f10f159a40b08a70cbb8c66f64c342 Author: Nicolas Vigier boklm@torproject.org Date: Mon Sep 17 12:37:17 2018 +0200
Bug 27552: Use bundled dir on CentOS/RHEL 6
On CentOS/RHEL 6, add the bundled directory from the firefox package to the LD_LIBRARY_PATH.
In addition, we don't reset anymore the previous LD_LIBRARY_PATH value, but only add new directories to it. This allows users to set LD_LIBRARY_PATH before starting the browser if additional libraries are needed. --- projects/firefox/start-firefox | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/projects/firefox/start-firefox b/projects/firefox/start-firefox index dc30574..7e7685c 100644 --- a/projects/firefox/start-firefox +++ b/projects/firefox/start-firefox @@ -2,13 +2,46 @@
basedir=$(dirname "$0")
-LD_LIBRARY_PATH="$basedir/TorBrowser/Tor/" +add_LD_LIBRARY_PATH() { + if test -z "$LD_LIBRARY_PATH" + then + LD_LIBRARY_PATH="$1" + else + LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH" + fi +} + +# Bug 27552: On CentOS/RHEL 6, we need to add the firefox bundled dir +# to LD_LIBRARY_PATH +if test -f /etc/system-release-cpe +then + if test "$(cut -d : -f 3 /etc/system-release-cpe)" = centos || \ + test "$(cut -d : -f 3 /etc/system-release-cpe)" = "enterprise_linux" + then + if test "$(cut -d : -f 5 /etc/system-release-cpe)" = "6" + then + if test -d /usr/lib64/firefox/bundled/lib64 + then + add_LD_LIBRARY_PATH /usr/lib64/firefox/bundled/lib64 + elif test -d /usr/lib/firefox/bundled/lib + then + add_LD_LIBRARY_PATH /usr/lib/firefox/bundled/lib + else + echo "Error: the firefox package (version 60 or more) is not installed." >&2 + echo "On CentOS/RHEL 6, Tor Browser requires the firefox package to be installed." >&2 + exit 1 + fi + fi + fi +fi + # Check if the system has a more recent version of libstdc++.so.6; if yes, use # that instead of the bundled version. "$basedir/abicheck" >/dev/null 2>&1 if [ $? -ne 0 ]; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$basedir/TorBrowser/Tor/libstdc++/" + add_LD_LIBRARY_PATH "$basedir/TorBrowser/Tor/libstdc++/" fi +add_LD_LIBRARY_PATH "$basedir/TorBrowser/Tor/" export LD_LIBRARY_PATH
exec "$basedir/firefox.real" "$@"
tbb-commits@lists.torproject.org