OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
security medium occasional DISPUTE

A polkit rule with the wrong permissions is ignored, and polkit.service still reports healthy

omarchy
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy 4.0.2-1 on 2026-09-18
AUDIT NOTE

Fetched all five cited sources. The pinned sha 9e4894c is the commit tagged 127 ("Release 127", 2025-12-17), matching the installed polkit 127-3. In polkitbackendduktapeauthority.c, load_scripts lists *.rules files and calls execute_script_with_runaway_killer, but the "Error loading script" message is emitted in runaway_killer_thread_execute_js when g_file_load_contents fails, which the record misplaced. Per-file success is logged at LOG_LEVEL_DEBUG, the summary at LOG_LEVEL_INFO, the error at LOG_LEVEL_ERROR. polkit_backend_authority_log drops anything above the configured level and passes the rest to syslog(), and the enum mirrors syslog priorities, so the shipped --log-level=notice hides info and debug and passes err, which makes the record's journal claim and the verify's -p err filter correct. data/polkit.service.in and the installed /usr/lib/systemd/system/polkit.service (owned by polkit 127-3) both carry --no-debug --log-level=notice and Type=notify-reload, and polkitd.c handles SIGHUP with a reload, so systemctl reload polkit is valid. polkitbackendcommon.c shows the directory monitor reloads only on CREATED, DELETED and CHANGES_DONE_HINT, so a chown or chmod alone does not trigger a reload, which the record's fix relied on without saying. The Arch wiki sentence "Rules must have root:polkitd ownership." is verbatim. GitHub issue 178 is open and its body is only a link to GitLab issue 177, whose description is empty, so the issue's whole content is its title, which the record quotes exactly. The claim that unreadable files are "most commonly" a umask problem had no source and is softened to an example, backed by the sudoers manual's statement that sudo takes the union of the user's umask and 0022. Locally /etc/polkit-1/rules.d is root:polkitd mode 750 and the unit runs as User=polkitd, read without root. Gate 1 passes on the open upstream issue and the documented wiki requirement, gates 2 and 3 pass, severity medium matches the brief's scale. applies_to says omarchy but this is generic Arch polkit behaviour that happens to be true on Omarchy. No rule file was installed and nothing was exercised.

The cause above was rewritten on 2026-09-18 to match this note; the fix was corrected by the audit itself.
RISK

systemctl status polkit reports the unit healthy whether or not any given rule file actually loaded. The loader skips a script it cannot open and continues rather than failing the unit, confirmed by reading load_scripts() in polkitbackendduktapeauthority.c at the tag matching the installed polkit 127-3 package. A permission mistake in one rule file does not surface as a service problem, only as a rule that quietly does not apply, so checking that polkit is running tells you nothing about whether your rule is in effect.

Symptom

A custom rule dropped into /etc/polkit-1/rules.d/ does not change any authentication prompt. systemctl status polkit shows the service active the whole time, with nothing to say why the rule had no effect.

Cause

polkitd's script loader (load_scripts in polkitbackendduktapeauthority.c) lists every *.rules file in each rules directory, sorts them, and hands each one to execute_script_with_runaway_killer. That runs runaway_killer_thread_execute_js, which reads the file with g_file_load_contents. When the read fails, for example because the file is owned root:root with mode 600 and the daemon runs as the unprivileged polkitd user, it logs "Error loading script <file>" at error level and returns, and load_scripts moves on to the next file rather than stopping. The message reaches the journal, because polkit_backend_authority_log passes anything at or above the configured level to syslog(), but nothing fails the systemd unit over it. What loaded successfully is logged per file at debug level and summarised at info level ("Finished loading, compiling and executing %d rules"), and the Arch package's polkit.service, which is upstream's own data/polkit.service.in unchanged, starts the daemon with --no-debug --log-level=notice, so both of those messages are dropped and only the per-file error survives. The daemon's directory monitor reloads rules only when a file is created, deleted or finished being written, so fixing the permissions with chmod or chown alone does not make it re-read the file. The Arch wiki's polkit page states the requirement this trips: "Rules must have root:polkitd ownership." A file created through sudo inherits at least the calling user's umask, because sudo takes the union of the user's umask and its own default of 0022 and never lowers it, so a umask of 077 produces a root:root mode 600 file that polkitd cannot read whatever the rule says. Upstream's own issue tracker carries this exact framing, still open: "even when no rules are loaded (permission denied), polkit.service succeeds in journal."

Fix

Give the rule file group polkitd and group read, or make it world readable. Set the permissions explicitly rather than relying on whatever umask was active when the file was created:


sudo chown root:polkitd /etc/polkit-1/rules.d/<name>.rules
sudo chmod 640 /etc/polkit-1/rules.d/<name>.rules

Then reload polkit. This step is required: polkitd re-reads the directory on its own when a rule file is created, deleted or written, but not when only its owner or mode changes. The unit is Type=notify-reload, so reload sends the SIGHUP the daemon answers by loading every rule again:


sudo systemctl reload polkit

Verify

Check the file's actual mode and owner rather than trusting how it was created:


sudo stat -c '%a %U:%G' /etc/polkit-1/rules.d/<name>.rules

Then confirm the daemon did not log a load failure for it, since the service itself will report active either way:


journalctl -u polkit -p err -b | grep 'Error loading script'

No line naming the file means it was at least readable when polkit last loaded rules.

Sources

polkit-rule-wrong-permissions-silently-ignored