Repository navigation
Conversation
|
|
Nice hardening — scoping session Two notes before merge:
if pgrep -u "$UID" -x "1password" >/dev/null && omarchy-cmd-present 1password; then |
1cab324 to
0cd6bd5
Compare
|
Rebased onto Three open PRs change the same lines, so whichever of them lands after this one needs a small follow-up:
If any of them merges first, I'll rebase this PR and update the affected test here. |
|
This pull request has not been reviewed yet. Classifying an item takes two models agreeing: Claude Opus 5.5 read it as a bug fix, but the second opinion (Codex Medium) could not run because its daily review budget is spent. With no agreement there is no class label, and nothing was run on a worker. It will be picked up again once the second opinion is available. Two things turned up while reading, neither run on a worker:
Waiting on the second opinion; after that, the review, a reproduction on a worker and the suite. |
pkillandpgrepscan every user's process table, while signals only reach the caller's own processes. The session commands inbin/assume the scan and the signal cover the same set. They do not as soon as a second local account exists.What that looks like on a machine with two accounts. Account B runs a process named
kitty, account A runs the command:B's process stays alive, and A never had a kitty to reload in the first place. The unscoped form either throws EPERM errors at a user who can do nothing about them (
font-set,display-text-size), or its guard reports "running" for a process the user can never signal (restart-helixdecides to reload, the kill fails silently). The webcam overlay cleanup, the slurp dismissal, the screensaver teardown and the Battle.net prefix stop reach across accounts the same way.The change
Adds
-u "$UID"to thepgrep/pkillcalls in 13 scripts that target processes belonging to the login session running the command: terminal reload signals, screensaver teardown, slurp dismissal, webcam overlay cleanup,omarchy restart-app, the Battle.net prefix stop, the Claude desktop quit. Where apgrepguard sits in front of a scopedpkill, the guard is scoped too, so the check and the signal look at the same set.This is the rule #14431 already picked for recording detection:
omarchy-capture-screenrecording-processusespgrep -u "$UID"plus a/proc/<pid>/exeidentity check. This PR extends it to the rest of the session commands.omarchy-restart-xcomposegot the same scoping upstream in #14433, so this branch no longer touches it. The third commit scopes the 1Password guard inomarchy-system-lock, as suggested in review.Nothing a legitimate flow can notice. These processes are owned by the session that runs the command, and cross-uid matches never received a signal from these commands before this change either. The
tailscaledsystem daemon check and-Pparent-scoped child kills are untouched.Proof
The same two accounts, with the flag in place:
test/clipasses on this branch, including the Hunk retint tests.test/shellends with exactly the failure set ofquattroat 4c1b4cb run in the same Arch container (64 files fail on both for lack of a desktop session). Three test files that pin the old command strings (command-operand-boundaries,system-lock,remove-ai) are updated in the second commit to expect the-u "$UID"argument, and they keep their literal-operand and ordering checks.bash -non every changed script.Manual passes worth doing after merge:
omarchy font-setwith kitty and ghostty open, a theme switch on a Hunk or btop theme,omarchy screenrecord --with-webcamstart and stop, screensaver exit,omarchy remove-gaming-battlenetwith a game running.