Commit 172d8e9f authored by Tails developers's avatar Tails developers

Properly refactor the chroot browser cleanup.

parent 333c4566
......@@ -27,11 +27,13 @@ try_cleanup_browser_chroot () {
setup_browser_chroot () {
local chroot="${1}"
local cow="${2}"
local user="${3}"
# FIXME: When LXC matures to the point where it becomes a viable option
# for creating isolated jails, the chroot can be used as its rootfs.
trap cleanup INT
trap cleanup EXIT
local cleanup_cmd="try_cleanup_browser_chroot \"${chroot}\" \"${cow}\" \"${user}\""
trap "${cleanup_cmd}" INT EXIT
local rootfs_dir
local rootfs_dirs_path="/lib/live/mount/rootfs"
......
......@@ -18,10 +18,6 @@ set -e
# Import i2p_router_console_is_ready().
. /usr/local/lib/tails-shell-library/i2p.sh
cleanup () {
try_cleanup_browser_chroot "${CHROOT}" "${COW}" "${BROWSER_USER}"
}
error () {
local cli_text="${CMD}: `gettext \"error:\"` ${@}"
local dialog_text="<b><big>`gettext \"Error\"`</big></b>
......@@ -110,7 +106,7 @@ fi
show_start_notification
echo "* Setting up chroot"
setup_browser_chroot "${CHROOT}" "${COW}" || \
setup_browser_chroot "${CHROOT}" "${COW}" "${BROWSER_USER}" || \
error "`gettext \"Failed to setup chroot.\"`"
echo "* Configuring chroot"
......
......@@ -15,10 +15,6 @@ set -e
# and run_chroot_browser().
. /usr/local/lib/tails-shell-library/chroot-browser.sh
cleanup () {
try_cleanup_browser_chroot "${CHROOT}" "${COW}" "${BROWSER_USER}"
}
error () {
local cli_text="${CMD}: `gettext \"error:\"` ${@}"
local dialog_text="<b><big>`gettext \"Error\"`</big></b>
......@@ -117,7 +113,7 @@ verify_start
show_start_notification
echo "* Setting up chroot"
setup_browser_chroot "${CHROOT}" "${COW}" || \
setup_browser_chroot "${CHROOT}" "${COW}" "${BROWSER_USER}" || \
error "`gettext \"Failed to setup chroot.\"`"
echo "* Configuring chroot"
......
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