Managed policy dirs are enterprise trust roots, so they stay 0755 root:root. The menu path takes root for that one write through a sudoers glob of six hex digits, the same shape as omarchy-dns, and falls back to pkexec where the grant is not installed. Drop omarchy-browser-policy; a group member could plant any JSON, not just a colour.
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
|