Commit 8cd79834 authored by Tails developers's avatar Tails developers

Refactor TBB firefox start into exec_firefox() library function.

That way one only has to remember to always call firefox with
exec_firefox(), and not to set LD_LIBRARY_PATH. As an example, this
was forgotten for Tor Launcher, which also was fixed.
parent c6e34ff7
......@@ -2,7 +2,7 @@
set -e
# Import the TBB_INSTALL variable
# Import exec_firefox()
. /usr/local/lib/tails-shell-library/tor-browser.sh
# The Tor Browser hardcodes the default profile dir to ../.. from the
......@@ -27,4 +27,4 @@ EOF
ln -s /var/lib/tails-user-session/browser-locale.js \
"${HOME}"/.tor-launcher/TorBrowser/Data/Browser/profile.default/preferences/locale.js
fi
exec "${TBB_INSTALL}"/Browser/firefox --app "${HOME}"/.tor-launcher/tor-launcher-standalone/application.ini
exec_firefox -app "${HOME}"/.tor-launcher/tor-launcher-standalone/application.ini
......@@ -11,7 +11,7 @@ export TEXTDOMAIN
PROFILE="${HOME}/.tor-browser/profile.default"
# Import the TBB_INSTALL variable
# Import exec_firefox()
. /usr/local/lib/tails-shell-library/tor-browser.sh
ask_for_confirmation() {
......@@ -43,10 +43,7 @@ start_browser() {
unset SESSION_MANAGER
LD_LIBRARY_PATH="${TBB_INSTALL}"/Browser
export LD_LIBRARY_PATH
exec "${TBB_INSTALL}"/Browser/firefox -allow-remote --class "Tor Browser" -profile "${PROFILE}" "${@}"
exec_firefox -allow-remote --class "Tor Browser" -profile "${PROFILE}" "${@}"
}
......
......@@ -3,3 +3,9 @@
TBB_INSTALL=/usr/local/lib/tor-browser
TBB_PROFILE=/etc/tor-browser/profile
TBB_EXT="${TBB_INSTALL}/extensions"
exec_firefox() {
LD_LIBRARY_PATH="${TBB_INSTALL}"/Browser
export LD_LIBRARY_PATH
exec "${TBB_INSTALL}"/Browser/firefox "${@}"
}
......@@ -214,7 +214,10 @@ run_browser_in_chroot () {
echo "* Starting Unsafe Browser"
sudo -u ${SUDO_USER} xhost +SI:localuser:${CLEARNET_USER} 2>/dev/null
chroot ${CHROOT} sudo -u ${CLEARNET_USER} LD_LIBRARY_PATH="${TBB_INSTALL}"/Browser "${TBB_INSTALL}"/Browser/firefox -DISPLAY=:0.0 -profile /home/clearnet/.tor-browser/profile.default
chroot ${CHROOT} sudo -u ${CLEARNET_USER} /bin/sh -c \
'. /usr/local/lib/tails-shell-library/tor-browser.sh && \
exec_firefox -DISPLAY=:0.0 \
-profile /home/clearnet/.tor-browser/profile.default'
sudo -u ${SUDO_USER} xhost -SI:localuser:${CLEARNET_USER} 2>/dev/null
}
......
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