Commit a0420227 authored by boklm's avatar boklm Committed by Georg Koppen
Browse files

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.
parent 3b81575a
......@@ -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" "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment