Commit 54c4ac55 authored by Tails developers's avatar Tails developers
Browse files

Make sure extensions are symlinked, not copied.

We could use `cp --no-dereference` before, when the TBB_EXT dir only
contained symlinks. This will reduce the memory footprint of the
chroot browsers, and incidentally fixed a bug where the
unsafe-browser's name wasn't set since we copied the langpack before
we fix the name in it.
parent 8d79c281
...@@ -155,7 +155,8 @@ configure_chroot_browser () { ...@@ -155,7 +155,8 @@ configure_chroot_browser () {
local browser_name="${1}" ; shift local browser_name="${1}" ; shift
local browser_user="${1}" ; shift local browser_user="${1}" ; shift
local startpage="${1}" ; shift local startpage="${1}" ; shift
# Now $@ is a list of extensions to enable # Now $@ is a list of paths (that must be valid after chrooting)
# to extensions to enable.
# Prevent sudo from complaining about failing to resolve the 'amnesia' host # Prevent sudo from complaining about failing to resolve the 'amnesia' host
echo "127.0.0.1 localhost amnesia" > ${chroot}/etc/hosts echo "127.0.0.1 localhost amnesia" > ${chroot}/etc/hosts
...@@ -167,7 +168,11 @@ configure_chroot_browser () { ...@@ -167,7 +168,11 @@ configure_chroot_browser () {
mkdir -p "${browser_profile}" "${browser_ext}" mkdir -p "${browser_profile}" "${browser_ext}"
# Select extensions to enable # Select extensions to enable
cp --no-dereference "${@}" "${browser_ext}" local extension
while [ -n "${*}" ]; do
extension="${1}" ; shift
ln -s "${extension}" "${browser_ext}"
done
# Set preferences # Set preferences
local browser_prefs="${browser_profile}"/preferences/prefs.js local browser_prefs="${browser_profile}"/preferences/prefs.js
......
...@@ -107,7 +107,7 @@ setup_browser_chroot ${CHROOT} ${COW} || \ ...@@ -107,7 +107,7 @@ setup_browser_chroot ${CHROOT} ${COW} || \
echo "* Configuring chroot" echo "* Configuring chroot"
configure_chroot_dns_servers "${CHROOT}" "127.0.0.1" configure_chroot_dns_servers "${CHROOT}" "127.0.0.1"
configure_chroot_browser "${CHROOT}" "${BROWSER_NAME}" "${BROWSER_USER}" \ configure_chroot_browser "${CHROOT}" "${BROWSER_NAME}" "${BROWSER_USER}" \
"${START_PAGE}" "${CHROOT}/${TBB_EXT}"/langpack-*.xpi \ "${START_PAGE}" "${TBB_EXT}"/langpack-*.xpi \
"${NOSCRIPT_EXT_XPI}" "${TORBUTTON_EXT_DIR}" "${NOSCRIPT_EXT_XPI}" "${TORBUTTON_EXT_DIR}"
copy_extra_tbb_prefs "${CHROOT}" "${BROWSER_USER}" copy_extra_tbb_prefs "${CHROOT}" "${BROWSER_USER}"
BEST_LOCALE="$(guess_best_tor_browser_locale)" BEST_LOCALE="$(guess_best_tor_browser_locale)"
......
...@@ -114,7 +114,7 @@ setup_browser_chroot ${CHROOT} ${COW} || \ ...@@ -114,7 +114,7 @@ setup_browser_chroot ${CHROOT} ${COW} || \
echo "* Configuring chroot" echo "* Configuring chroot"
configure_chroot_dns_servers "${CHROOT}" "${IP4_NAMESERVERS}" configure_chroot_dns_servers "${CHROOT}" "${IP4_NAMESERVERS}"
configure_chroot_browser "${CHROOT}" "${BROWSER_NAME}" "${BROWSER_USER}" \ configure_chroot_browser "${CHROOT}" "${BROWSER_NAME}" "${BROWSER_USER}" \
"${START_PAGE}" "${CHROOT}/${TBB_EXT}"/langpack-*.xpi "${START_PAGE}" "${TBB_EXT}"/langpack-*.xpi
BEST_LOCALE="$(guess_best_tor_browser_locale)" BEST_LOCALE="$(guess_best_tor_browser_locale)"
set_chroot_browser_locale "${CHROOT}" "${BROWSER_USER}" "${BEST_LOCALE}" set_chroot_browser_locale "${CHROOT}" "${BROWSER_USER}" "${BEST_LOCALE}"
set_chroot_browser_name ${CHROOT} "`gettext \"Unsafe Browser\"`" "${BEST_LOCALE}" set_chroot_browser_name ${CHROOT} "`gettext \"Unsafe Browser\"`" "${BEST_LOCALE}"
......
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