Cherry-picked from quattro (7d58bb9a).
Stop world-writable Chromium and Firefox policy directories: create them
root-owned at 0755, purge non-root entries, refuse planted symlinks, and
write the browser theme colour through a passwordless helper instead of
a world-writable policy file.
Conflict resolution for v4-0-2:
- bin/omarchy-install-browser: dropped the `chromium)` case, which does
not exist on this branch.
- test/shell.d/default-apps-test.sh: dropped; the file does not exist on
this branch.
28 lines
734 B
Bash
28 lines
734 B
Bash
echo "Stop world-writable Chromium and Firefox policy directories"
|
|
|
|
source "$OMARCHY_PATH/install/helpers/browser-policy.sh"
|
|
|
|
repaired=0
|
|
for dir in "${BROWSER_POLICY_MANAGED_DIRS[@]}"; do
|
|
[[ -d $dir || -L $dir ]] || continue
|
|
browser_policy_setup_dir "$dir"
|
|
repaired=1
|
|
done
|
|
|
|
if (( repaired )); then
|
|
omarchy-theme-set-browser
|
|
fi
|
|
|
|
for dir in "${BROWSER_POLICY_FIREFOX_DIRS[@]}"; do
|
|
[[ -d $dir || -L $dir ]] || continue
|
|
if browser_policy_firefox_hardened "$dir"; then
|
|
browser_policy_purge_dir "$dir"
|
|
continue
|
|
fi
|
|
browser_policy_setup_parent "$dir"
|
|
browser_policy_purge_dir "$dir"
|
|
if ! browser_policy_firefox_policy_file_ok "$dir/policies.json"; then
|
|
browser_policy_install_firefox_policies "$dir"
|
|
fi
|
|
done
|