omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

1password 8.12.36-2: polkit policy bakes in build host's user; vendor after-install.sh never run (same cause as #11830)

Open edgardoalz opened this issue 2 months ago • 3 comments

What happened

The [omarchy] repo's 1password 8.12.36-2 ships a polkit policy with the build host's username baked in, instead of the installing user's.

/usr/share/polkit-1/actions/com.1password.1Password.policy as installed:

<action id="com.1password.1Password.authorizeCLI">
  ...
  <annotate key="org.freedesktop.policykit.owner">unix-user:builder </annotate>
</action>
<action id="com.1password.1Password.authorizeSshAgent">
  ...
  <annotate key="org.freedesktop.policykit.owner">unix-user:builder </annotate>
</action>

builder is the account on the repo's build machine. It does not exist on the installed system, so both actions are owned by a non-existent principal on every machine that installs this package.

Root cause

This generation step is meant to run on the target machine. 1Password's own bundled installer, shipped inside the package at /opt/1Password/after-install.sh, does it at lines 109–117:

# Fill in policy kit file with a list of (the first 10) human users of the system.
export POLICY_OWNERS
POLICY_OWNERS="$(cut -d: -f1,3 /etc/passwd | grep -E ':[0-9]{4}$' | cut -d: -f1 | head -n 10 | sed 's/^/unix-user:/' | tr '\n' ' ')"
...
install -Dm0644 ./com.1password.1Password.policy -t /usr/share/polkit-1/actions/

The packaging instead runs that expansion at build time (inherited from the AUR PKGBUILD's package()), which is sound when each user builds locally but wrong for a prebuilt binary repo — it captures the builder's /etc/passwd.

The package's install hook (/var/lib/pacman/local/1password-8.12.36-2/install) creates the onepassword group and sets up 1Password-BrowserSupport, but never invokes after-install.sh.

This is the same root cause as #11830

#11830 reports the MCP group/setgid setup missing from this same package version. That setup is also in after-install.sh, at lines 147–148:

# Setup the MCP server binary with its own group and setgid so OPH can verify
# connecting peers via SO_PEERCRED.

Both bugs are the one omission — the vendor's install-time script is shipped but never run. I confirmed #11830 reproduces on this machine as well (getent group onepassword-mcp returns nothing).

after-install.sh cannot currently be used as a local repair

The packaging deletes com.1password.1Password.policy.tpl, which after-install.sh reads at line 113. So running the vendor script by hand fails at the polkit step. Any fix needs to retain the template in the package.

Expected

The polkit owner annotation should name users on the installing system.

Impact

Limited to the two annotated actions:

  • com.1password.1Password.authorizeCLI — 1Password CLI (op) authorizing against the desktop app
  • com.1password.1Password.authorizeSshAgent — the 1Password SSH agent

com.1password.1Password.unlock has no owner annotation, so desktop and fingerprint unlock are unaffected. GUI-only users will not notice, which likely explains why this went unreported while #11830's louder MCP failure did not.

Steps to reproduce

  1. omarchy pkg add 1password (resolves from [omarchy], not the AUR)
  2. grep owner /usr/share/polkit-1/actions/com.1password.1Password.policy
  3. Observe unix-user:builder rather than the local user

Suggested fix

Run the vendor's after-install.sh (or port its logic) from post_install/post_upgrade, and stop deleting com.1password.1Password.policy.tpl so the polkit step can execute. That addresses this report and #11830 together, and keeps future install-time steps from drifting out of the package.

Notes

  • [omarchy] ships 8.12.36-2; the AUR is at 8.12.36-42. Same upstream app version, 40 packaging revisions apart — possibly worth checking separately whether the repo build tracks AUR packaging fixes.
  • Signature and checksum validate correctly (Validated By: SHA-256 Sum Signature). This is a packaging-correctness bug, not an integrity or security one.

System

Omarchy 4.0.4-1 (stable channel)
Kernel 7.2.5-3-omarchy
CPU AMD Ryzen 5 PRO 4650U with Radeon Graphics
GPU AMD Renoir (Radeon Vega Mobile Series)
Package 1password 8.12.36-2, repo [omarchy], built 2026-09-12

omarchy debug --no-sudo --print is not a valid command on this installation (Unknown Omarchy command), so no generated debug bundle is attached — same as noted in #11830.

edgardoalz avatar Sep 15 '26 23:09 edgardoalz

I reproduced this on a fresh Omarchy worker. 1password 8.12.36-2 from [omarchy] installs com.1password.1Password.policy with unix-user:builder as the owner of authorizeCLI and authorizeSshAgent. That machine has no builder user, and /opt/1Password/com.1password.1Password.policy.tpl isn't there either. The package source in omacom/omarchy-pkgs still has the same problem on master, which now builds 8.12.40-2. package() in pkgbuilds/1password/PKGBUILD reads the build host's /etc/passwd to fill in the owners, and 1password.install never rewrites them. Upgrading won't fix it.

Two open pull requests address this:

  • #12715 rewrites the owners to the local users from an Omarchy helper, a migration and a pacman hook. It also does the MCP setup from #11830 and says it closes both issues.
  • omacom/omarchy-pkgs#489 changes the package so it ships a fixed unix-group:wheel owner. Going by polkit's source, that wouldn't restore what the vendor intended. polkit compares each owner in the annotation with the caller's user identity using polkit_identity_equal, which returns false when the two identity types differ (src/polkit/polkitidentity.c:109, called from may_identity_check_authorization in src/polkitbackend/polkitbackendinteractiveauthority.c). It never checks group membership. So a unix-group: owner never matches anyone, and the actions would be left with no usable owner, just as they are with builder.

How much this breaks in practice is less clear than the issue suggests. polkit only checks the owner list when the caller passes details, when the subject belongs to a different user, or when the subject's user can't be confirmed (polkitbackendinteractiveauthority.c:1119). A query about a process owned by the same user, with no details, never reaches it. I haven't confirmed whether 1Password's CLI or SSH-agent requests meet one of those conditions. The policy is wrong either way, but I didn't observe a failed authorization.

Codex at medium effort checked this separately against the same package source and polkit's source. It agreed on all three points: the bug is still on master, #489's group owner can never match, and the owner list only matters in the cases above. It is also how #12715 came up here. Its independence isn't guaranteed. It considers #11830 a different bug with the same packaging cause, and I agree.

This now waits on the maintainer to decide whether to fix it in the package, in Omarchy (#12715), or both. #12715's latest review describes how it conflicts with omacom/omarchy-pkgs#442 and #489.

omarchybot avatar Oct 12 '26 02:10 omarchybot

Same packaging miss as #11830: the [omarchy] 1Password package never runs the vendor after-install, so polkit owners stay baked to the build host. Open fix path is #12715. Fine to close this as a duplicate of #11830 once that lands.

jandrusk avatar Oct 13 '26 16:10 jandrusk

This shouldn't be closed when #11830 is. omacom/omarchy-pkgs#442, the package-side fix for #11830, only adds the MCP group, the setgid bit and the two symlinks. It doesn't change how the polkit owners are filled in: package() in pkgbuilds/1password/PKGBUILD on master still expands POLICY_OWNERS from the build host's /etc/passwd and installs the result to /usr/share/polkit-1/actions/. If #442 merges and #11830 closes, the unix-user:builder owner from this issue would still ship. The two are separate bugs with the same packaging cause, not duplicates. Of the open pull requests, only #12715 fixes this one, and it already names both issues as closing.

I checked this against #442's diff and the master PKGBUILD. Codex at medium effort checked the same thing separately and came to the same conclusion. It couldn't reach GitHub's API and read the PKGBUILD and #442 over the web instead, and its independence isn't guaranteed. Nothing has changed since my last comment otherwise: this still waits on the maintainer to choose between fixing it in the package, in Omarchy (#12715), or both.

omarchybot avatar Oct 14 '26 14:10 omarchybot