Commit 3661a29a authored by Tails developers's avatar Tails developers
Browse files

Don't run cleanup if the chroot hasn't been setup.

parent abb2f276
...@@ -41,7 +41,6 @@ error () { ...@@ -41,7 +41,6 @@ error () {
Unsafe Browser will exit now." Unsafe Browser will exit now."
echo "${cli_text}" >&2 echo "${cli_text}" >&2
zenity --error --title "" --text "${dialog_text}" zenity --error --title "" --text "${dialog_text}"
cleanup
exit 1 exit 1
} }
...@@ -65,6 +64,9 @@ setup_chroot () { ...@@ -65,6 +64,9 @@ setup_chroot () {
# Setup a chroot on an aufs "fork" of the filesystem. # Setup a chroot on an aufs "fork" of the filesystem.
# FIXME: When LXC matures to the point where it becomes a viable option # 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. # for creating isolated jails, the chroot can be used as its rootfs.
trap cleanup INT
trap cleanup EXIT
mkdir -p ${ROFS} ${COW} ${CHROOT} && \ mkdir -p ${ROFS} ${COW} ${CHROOT} && \
mount -t squashfs -o loop ${SQUASH} ${ROFS} && \ mount -t squashfs -o loop ${SQUASH} ${ROFS} && \
mount -t tmpfs tmpfs ${COW} && \ mount -t tmpfs tmpfs ${COW} && \
...@@ -129,11 +131,9 @@ if [ -z "${IP4_NAMESERVERS}" ]; then ...@@ -129,11 +131,9 @@ if [ -z "${IP4_NAMESERVERS}" ]; then
fi fi
verify_start verify_start
trap cleanup INT
setup_chroot setup_chroot
configure_chroot configure_chroot
start_browser_in_chroot start_browser_in_chroot
cleanup
maybe_restart_tor maybe_restart_tor
exit 0 exit 0
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