Commit 7825b318 authored by Tails developers's avatar Tails developers
Browse files

Make the Unsafe Browser a bit more verbose to help debugging.

parent 234b0a52
...@@ -70,6 +70,8 @@ setup_chroot () { ...@@ -70,6 +70,8 @@ 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.
echo "* Setting up chroot"
trap cleanup INT trap cleanup INT
trap cleanup EXIT trap cleanup EXIT
...@@ -83,6 +85,8 @@ setup_chroot () { ...@@ -83,6 +85,8 @@ setup_chroot () {
} }
configure_chroot () { configure_chroot () {
echo "* Configuring chroot"
# Set the chroot's DNS servers to those obtained through DHCP # Set the chroot's DNS servers to those obtained through DHCP
rm -f ${CHROOT}/etc/resolv.conf rm -f ${CHROOT}/etc/resolv.conf
for NS in ${IP4_NAMESERVERS}; do for NS in ${IP4_NAMESERVERS}; do
...@@ -91,7 +95,7 @@ configure_chroot () { ...@@ -91,7 +95,7 @@ configure_chroot () {
chmod a+r ${CHROOT}/etc/resolv.conf chmod a+r ${CHROOT}/etc/resolv.conf
# Disable problematic Iceweasel addons and proxying in the chroot # Disable problematic Iceweasel addons and proxying in the chroot
chroot ${CHROOT} apt-get remove --yes ${OFFENDING_ADDONS} 1>/dev/null 2>&1 chroot ${CHROOT} apt-get remove --yes ${OFFENDING_ADDONS}
sed -i '/^pref("network.proxy.type",/d' \ sed -i '/^pref("network.proxy.type",/d' \
${CHROOT}/etc/iceweasel/pref/iceweasel.js ${CHROOT}/etc/iceweasel/pref/iceweasel.js
echo 'pref("network.proxy.type", 0);' >> \ echo 'pref("network.proxy.type", 0);' >> \
...@@ -109,6 +113,8 @@ user_pref("lightweightThemes.usedThemes", "[{\"id\":\"1\",\"name\":\"Unsafe Brow ...@@ -109,6 +113,8 @@ user_pref("lightweightThemes.usedThemes", "[{\"id\":\"1\",\"name\":\"Unsafe Brow
start_browser_in_chroot () { start_browser_in_chroot () {
# Start Iceweasel in the chroot # Start Iceweasel in the chroot
echo "* Starting Unsafe Browser"
sudo -u ${SUDO_USER} xhost +SI:localuser:${CLEARNET_USER} 2>/dev/null sudo -u ${SUDO_USER} xhost +SI:localuser:${CLEARNET_USER} 2>/dev/null
chroot ${CHROOT} sudo -u ${CLEARNET_USER} iceweasel -DISPLAY=:0.0 chroot ${CHROOT} sudo -u ${CLEARNET_USER} iceweasel -DISPLAY=:0.0
sudo -u ${SUDO_USER} xhost -SI:localuser:${CLEARNET_USER} 2>/dev/null sudo -u ${SUDO_USER} xhost -SI:localuser:${CLEARNET_USER} 2>/dev/null
...@@ -127,7 +133,8 @@ maybe_restart_tor () { ...@@ -127,7 +133,8 @@ maybe_restart_tor () {
# Tor from bootstrapping, and a restart is the fastest way to get # Tor from bootstrapping, and a restart is the fastest way to get
# wheels turning) # wheels turning)
if ! tor_is_working; then if ! tor_is_working; then
if ! service tor restart 2>/dev/null; then echo "* Restarting Tor"
if ! service tor restart; then
error "`gettext \"Failed to restart Tor.\"`" error "`gettext \"Failed to restart Tor.\"`"
fi fi
local counter=0 local counter=0
......
Supports Markdown
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