Skip to content

Narrow Ally TDP, autologin, and the masked power-profile path - #79

Merged
DanielJBurbridge merged 6 commits into
feat/ally-parity-integration-20261111from
fix/ally-security-correctness-20261117
Nov 17, 2026
Merged

DanielJBurbridge merged 6 commits into
feat/ally-parity-integration-20261111from
fix/ally-security-correctness-20261117

Conversation

@DanielJBurbridge

@DanielJBurbridge DanielJBurbridge commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

What changes

The integration audit found four places where the Ally path was wider or quieter than it should be.

  • The TDP polkit policy (allow_active=yes) was installed at hardware time, while the rules.d narrowing rule was written only in the session step. A desktop-only Ally, and the window before the session install, could set TDP. Hardware now writes a NO rule before the policy. The session step is the only YES, and only for the handheld user. Removing the session puts the NO rule back while the policy remains. Migration 1794842519 is unchanged and still runs hardware, then session when the gaming-session package is present, so both desktop-only and gaming-session Allys end correct.
  • write_rule used the rule template as a printf format. The username is now substituted as text (printf '%s'), so a % or \ in the template stays literal.
  • After three autologin failures, SDDM was restarted and the greeter pointer reloaded even off the handheld variant. Both now run only when handheld_variant is true. The %wheel NOPASSWD grant moved out of etc/sudoers.d into packages/omarchy-gaming-session 1.0.0-5, installed at /etc/sudoers.d/omarchy-handheld-autologin mode 0440 and checked with visudo -cf when visudo is present.
  • With power-profiles-daemon masked, omarchy-powerprofiles-set reasserted TDP and still recorded the requested profile. power-saver, balanced, and performance now map to the writer's live floor, battery SPL policy, and AC SPL policy. The profile is recorded only after that write succeeds. Unmasked and non-Ally behaviour is unchanged.
  • omarchy-session-start no longer starts steamos-manager.service and omarchy-ally-power.service from the dead ally-power marker, and the matching cleanup is gone.

Integ a478c5fc (#78) is merged. The gaming-session doc keeps that TDP paragraph, and records that session-start no longer names the missing units.

L200. /etc/sudoers.d/omarchy-handheld-autologin changes owner from omarchy-settings(-dev), which copies it with cp -a etc/., to omarchy-gaming-session 1.0.0-5. Install both packages in one pacman -U. Separate installs either conflict on that file or drop the grant and recreate the L145 relogin loop. The same line is in the handoff deploy and rollback steps.

Model: grok-4.7

Verification

  • bash test/shell.d/ally-tdp-test.sh — hardware-only and desktop-only migration leave a NO rule and no YES; a root-owned handheld user after the migration is YES, with %s and \n left literal; a masked profile applies the mapped tuple and a refused apply does not change the recorded profile; the shim still applies 20/20/25 on battery.
  • bash test/shell.d/powerprofiles-set-test.sh — unmasked profile set still records through powerprofilesctl.
  • bash test/shell.d/handheld-autologin-test.sh — three fails off the handheld variant write the stop file and do not restart SDDM; the grant is absent from etc/sudoers.d and the gaming-session PKGBUILD installs it at 0440.
  • bash test/shell.d/sudoers-test.sh — the base drop-ins still match, with the autologin grant removed.
  • bash test/shell.d/gaming-setup-test.sh — session-start has no ally-power references; the supervisor cases pass.
  • bash test/shell.d/pizzarchy-port-test.sh — the install script still has no NOPASSWD.
  • No Ally hardware deploy. shell/plugins/lock was not touched.

Screenshots

No visible change: polkit rules, sudoers packaging, profile recording, and a dead session-start branch. The panel and greeter look the same.

Open in Web Open in Cursor 

cursoragent and others added 4 commits November 17, 2026 02:00
Hardware used to install allow_active=yes with no rules.d file, so a
desktop-only Ally could set TDP. The deny rule is written before the
policy, and removing the session puts that deny rule back. The session
step is the only YES, and the username is substituted as text rather
than used as a printf format.

Model: grok-4.7
Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>
Once power-profiles-daemon is masked, a profile switch was a silent
reassert that still recorded the request. power-saver, balanced, and
performance now ask the capped writer for its live floor, battery SPL
policy, and AC SPL policy, and the profile is recorded only after that
write succeeds.

Model: grok-4.7
Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>
Three fail stamps restarted SDDM even off the handheld variant. The
greeter restart and pointer load now run only there. The wheel
NOPASSWD grant leaves the base sudoers tree and is installed by
omarchy-gaming-session.

Model: grok-4.7
Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>
The enabled marker started steamos-manager and omarchy-ally-power,
neither of which exists, and a missing unit aborted session start.
The marker, the unit list, and its cleanup are gone.

Model: grok-4.7
Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>

@DanielJBurbridge DanielJBurbridge left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev-red review: FAIL (mechanical only) at ddcc634

Blocker B1: this head conflicts with integ a478c5f (#77 and #78 merged) in docs/rog-ally-gaming-session.md. Re-merge integ. Tests also has to go green on the new head; it was still running on this one. Once both are done, I'll pass it on a narrow delta check (merge plus CI only).

The code is otherwise sound:

  • A3: write_deny_rule lands before the policy in install_hardware, the session install writes the user's YES rule before copying the policy, and remove_session restores the deny rule. Every caller (install/hardware/asus/ally-tdp.sh, migrations/1794842519.sh, omarchy-gaming-session.install) runs hardware before session when the gaming session is present, so the YES rule isn't overwritten. On a desktop-only Ally the end state is the policy plus the NO rule.
  • printf low: fixed. The name goes in by ${template//@USER@/$user} and is validated by handheld_user.
  • A4: restart_greeter and load_greeter_pointer are now gated on handheld_variant. The sudoers file moves to the gaming-session PKGBUILD with install -Dm440 and visudo -cf when it's available.
  • A5: profiles map to the writer's floor and its battery and AC SPL policies. It writes with --set, and an apply failure exits before the profile is recorded.
  • A6: the dead block and started_power_units are deleted.
  • All 4 commits have a Model trailer (grok-4.7). ally-tdp-test gives 20/20 and sudoers-test 7/7 locally. handheld-autologin-test and gaming-setup-test can't run on my box (no newuidmap), so CI decides those.

Medium follow-up (needs a line in the follow-ups and in DEPLOY, L200 if free): /etc/sudoers.d/omarchy-handheld-autologin changes owner from omarchy-settings(-dev), which cp -a etc/. in omarchy-pkgs, to omarchy-gaming-session. Two ways that can break:

  • If omarchy-gaming-session 1.0.0-5 is installed while the old settings package still owns the file, pacman refuses it as a file conflict.
  • If the settings package is upgraded alone, the grant vanishes, the relogin fallback's sudo -n is refused, and you get the L145 black-screen relogin loop when desktop-lock is on.

Nothing in the tree upgrades the gaming-session package, so install both packages in one pacman -U transaction, and say so in the deploy steps.

cursoragent and others added 2 commits November 17, 2026 02:10
Keep the #78 TDP paragraph, and record that session-start no longer
names the missing ally-power units.

Model: grok-4.7
Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>
L200: the sudoers file moves from omarchy-settings to
omarchy-gaming-session 1.0.0-5, so the two packages have to be
installed in one pacman -U or the grant conflicts or disappears.

Model: grok-4.7
Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>

@DanielJBurbridge DanielJBurbridge left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev-red delta review: PASS at 5e41cf5

  • B1 is fixed. Integ a478c5f is an ancestor of this head, and the docs/rog-ally-gaming-session.md conflict is resolved.
  • L200 is added in its own L200–L209 range. HANDOFF has the one-pacman -U rule for both deploy and rollback. No other follow-ups lines are removed compared with integ.
  • All new commits have a Model: grok-4.7 trailer.
  • Actions test and i18n-check are both green on this head.

The code for A3–A6 is unchanged since the review at ddcc634 (5931524047). Cleared to merge at this sha.

@DanielJBurbridge
DanielJBurbridge merged commit e742281 into feat/ally-parity-integration-20261111 Nov 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants