Skip to content

Commit bba65a9

Browse files
committed
Merge remote-tracking branch 'refs/remotes/ArrayBolt3/arraybolt3/trixie'
2 parents cb0e4ca + 7867b86 commit bba65a9

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

agents/bash.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Scripts use set -o errexit (set -e). Arithmetic pitfall: (( 0 ))
2+
returns exit code 1, which triggers errexit. Avoid (( var += 1 ))
3+
in favor of var=$((var + 1)), which is an assignment and always
4+
succeeds regardless of the computed value.

agents/sandbox.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sandbox-update-torbrowser runs under torsocks'd apt during postinst.
2+
torsocks breaks sudo. Use setpriv-tb-updater instead for privilege
3+
changes inside this script.
4+
5+
Do not use inotifywait or other inotify-based file watchers. The
6+
kernel's fs.inotify.max_user_watches pool is limited and easily
7+
exhausted on desktop systems (IDEs, file managers, etc.). Use polling
8+
with light_sleep instead.
9+
10+
Multi-browser architecture: the sandbox script is shared by Tor
11+
Browser, Mullvad Browser, and I2P Browser. Browser-specific paths
12+
come from variables set by the /usr/bin wrapper (tb_install_folder,
13+
tb_install_folder_dot, tb_browser_name, tb_global_binary_dir,
14+
SCRIPTNAME). Do not hardcode Tor Browser paths.

usr/libexec/tb-updater/sandbox-update-torbrowser

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ cleanup() {
9999
cgroup_empty_str="populated 0
100100
frozen 0"
101101
if printf '%s\n' '1' > "${tb_updater_cgroup}/cgroup.kill"; then
102-
## Poll cgroup.events until the cgropu is empty, rather than using
102+
## Poll cgroup.events until the cgroup is empty, rather than using
103103
## inotifywait. This avoids consuming inotify watches, which are more
104104
## resource-constrained than CPU power in this scenario.
105105
cgroup_drained='false'
@@ -113,7 +113,7 @@ frozen 0"
113113
fi
114114

115115
light_sleep 0.1
116-
(( poll_count += 1 )) || true
116+
poll_count=$((poll_count + 1))
117117
done
118118

119119
if [ "${cgroup_drained}" = 'false' ]; then

0 commit comments

Comments
 (0)