Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tails
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
947
Issues
947
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tails
tails
Commits
57135a4f
Commit
57135a4f
authored
Oct 20, 2014
by
Tails developers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor chroot browsers' run_browser_in_chroot().
parent
6f6a8fdc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
26 deletions
+18
-26
config/chroot_local-includes/usr/local/lib/tails-shell-library/chroot-browser.sh
...ludes/usr/local/lib/tails-shell-library/chroot-browser.sh
+14
-0
config/chroot_local-includes/usr/local/sbin/i2p-browser
config/chroot_local-includes/usr/local/sbin/i2p-browser
+2
-13
config/chroot_local-includes/usr/local/sbin/unsafe-browser
config/chroot_local-includes/usr/local/sbin/unsafe-browser
+2
-13
No files found.
config/chroot_local-includes/usr/local/lib/tails-shell-library/chroot-browser.sh
View file @
57135a4f
...
...
@@ -90,3 +90,17 @@ set_chroot_browser_name () {
chmod
a+r
"
${
pack
}
"
rm
-Rf
"
${
tmp
}
"
}
# Start the browser in the chroot
run_chroot_browser
()
{
local chroot
=
"
${
1
}
"
local
chroot_user
=
"
${
2
}
"
local
local_user
=
"
${
3
}
"
sudo
-u
${
local_user
}
xhost +SI:localuser:
${
chroot_user
}
2>/dev/null
chroot
${
chroot
}
sudo
-u
${
chroot_user
}
/bin/sh
-c
\
'. /usr/local/lib/tails-shell-library/tor-browser.sh && \
exec_firefox -DISPLAY=:0.0 \
-profile /home/'
"
${
chroot_user
}
"
'/.tor-browser/profile.default'
sudo
-u
${
local_user
}
xhost
-SI
:localuser:
${
chroot_user
}
2>/dev/null
}
config/chroot_local-includes/usr/local/sbin/i2p-browser
View file @
57135a4f
...
...
@@ -279,18 +279,6 @@ EOF
}
run_browser_in_chroot
()
{
# Start Iceweasel in the chroot
echo
"* Starting I2P Browser"
sudo
-u
${
SUDO_USER
}
xhost +SI:localuser:
${
BROWSER_USER
}
2>/dev/null
chroot
${
CHROOT
}
sudo
-u
${
BROWSER_USER
}
/bin/sh
-c
\
". /usr/local/lib/tails-shell-library/tor-browser.sh &&
\
exec_firefox -DISPLAY=:0.0
\
-profile /home/
${
BROWSER_USER
}
/.tor-browser/profile.default"
sudo
-u
${
SUDO_USER
}
xhost
-SI
:localuser:
${
BROWSER_USER
}
2>/dev/null
}
show_shutdown_notification
()
{
local
title
=
"
`
gettext
\"
Shutting down the I2P Browser...
\"
`
"
local
body
=
"
`
gettext
\"
This may take a
while
, and you may not restart the I2P Browser
until
it is properly shut down.
\"
`
"
...
...
@@ -311,7 +299,8 @@ echo "* Setting up chroot"
setup_browser_chroot
${
CHROOT
}
${
COW
}
||
\
error
"
`
gettext
\"
Failed to setup chroot.
\"
`
"
configure_chroot
run_browser_in_chroot
echo
"* Starting I2P Browser"
run_chroot_browser
${
CHROOT
}
${
BROWSER_USER
}
${
SUDO_USER
}
show_shutdown_notification
exit
0
config/chroot_local-includes/usr/local/sbin/unsafe-browser
View file @
57135a4f
...
...
@@ -157,18 +157,6 @@ EOF
}
run_browser_in_chroot
()
{
# Start the browser in the chroot
echo
"* Starting Unsafe Browser"
sudo
-u
${
SUDO_USER
}
xhost +SI:localuser:
${
CLEARNET_USER
}
2>/dev/null
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
}
show_shutdown_notification
()
{
local
title
=
"
`
gettext
\"
Shutting down the Unsafe Browser...
\"
`
"
local
body
=
"
`
gettext
\"
This may take a
while
, and you may not restart the Unsafe Browser
until
it is properly shut down.
\"
`
"
...
...
@@ -213,7 +201,8 @@ echo "* Setting up chroot"
setup_browser_chroot
${
CHROOT
}
${
COW
}
||
\
error
"
`
gettext
\"
Failed to setup chroot.
\"
`
"
configure_chroot
run_browser_in_chroot
echo
"* Starting Unsafe Browser"
run_chroot_browser
${
CHROOT
}
${
CLEARNET_USER
}
${
SUDO_USER
}
show_shutdown_notification
maybe_restart_tor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment