Skip to content

Do not block SDDM autologin on pam_gnome_keyring - #13625

Open
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-autologin-keyring-e0d3
Open

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-autologin-keyring-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13414

Autologin stayed on a black screen for ~30s while pam_gnome_keyring blocked the session.

Change

  • Avoid blocking SDDM autologin on the keyring PAM module

Test plan

  • Autologin on a machine with gnome-keyring; session should reach the desktop without a long black screen

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-autologin-keyring-e0d3 branch from 6f82f5a to 3bf1940 Compare September 29, 2026 21:10
@omarchybot omarchybot added the bug Something isn't working label Oct 1, 2026
Migrations run through `bash -euo pipefail`, not their executable bit, and agents/skills/migrations.md requires 0644; this was the only 0755 file in migrations/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5.5, with a second opinion from Codex Medium, and tested on a worker built from the Omarchy ISO (sddm 0.21.0-7, gnome-keyring 1:50.0-1).

Reproduction. On the stock install, sddm-helper waits for the keyring daemon to start before it launches the Wayland session: gkr-pam: couldn't unlock the login keyring and Starting Wayland user session are logged only once systemd reports Started GNOME Keyring daemon, which is the same sequence as #13414. I made the daemon slow to start by giving gnome-keyring-daemon.service a 20-second ExecStartPre delay, then rebooted three times:

  • base PAM file: the session started 20.1s after session opened
  • after running this PR's migration: the session started 96ms after session opened, while the daemon kept starting in the background
  • with the original PAM file restored: back to 20.1s

The 20-second delay was injected, so this proves the mechanism: SDDM no longer waits on the keyring before starting the session. It does not explain why the reporter's daemon took 30s to start on that boot. After the change, secret-tool store/lookup still worked against the passwordless Default keyring through socket activation. The migration is idempotent on rerun, and sourcing install/login/sddm.sh as root clears both pam_gnome_keyring lines from sddm-autologin.

Pushed: f0de6fc sets migrations/1790544001.sh to mode 0644. The migration rules require 0644, and it was the only executable file in migrations/.

Tests: on the worker, test/shell.d/sddm-keyring-pam-test.sh passes. ./test/cli has one failure, vscode generated theme references current theme file, which fails the same way on quattro and is unrelated. The full ./test/shell suite was not run.

Second opinion (Codex Medium): it agreed the change is proportionate. It also confirmed that nothing a stock install relies on is lost: the daemon is still socket- and D-Bus-activated, GNOME_KEYRING_CONTROL is no longer exported upstream, and Omarchy's SSH agent is gcr-ssh-agent. Independence is not guaranteed. It raised two edge cases that only affect a hand-edited /etc/pam.d/sddm-autologin:

  • the unanchored sed '/pam_gnome_keyring\.so/d' would also delete another rule whose trailing comment mentions the module, or split a backslash-continued rule
  • if the file is unreadable to the user (mode 0600), grep errors and the || exit 0 marks the migration done without applying it

Neither applies to the stock file, so I left the code as it is.

Next: this waits on the maintainer. The second opinion's edge cases above are theirs to accept or reject. @odcpw, if you can confirm on your T14 that autologin no longer stalls with this change, that would cover the trigger the worker could only simulate.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Modifies PAM authentication configuration for login.

The PR should not merge until the new test can pass when the PAM lines are correctly removed.

Findings

  1. P1 Successful removal fails the test ▶
  2. P2 Privileged migration path is untested ▶

Summary

The PR removes pam_gnome_keyring from SDDM autologin for fresh installations and existing systems, and adds a shell regression test.

  • The new test exits unsuccessfully on the intended no-match result.
  • Its migration fixture does not cover the privileged path used for the installed PAM file.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Fresh install] --> B[Login-stage PAM edit]
  C[Existing installation] --> D[User migration]
  D --> E[Privileged PAM edit]
  B --> F[SDDM autologin without keyring PAM step]
  E --> F
Loading

Reviews (1) · Last reviewed commit: "Make the autologin keyring migration 064..."

Comment on lines +46 to +47
grep -q 'pam_gnome_keyring\.so' "$tmp_dir/sddm" &&
fail "password SDDM PAM still references gnome-keyring auth/password" "$(cat "$tmp_dir/sddm")"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Successful removal fails the test. When the install script correctly removes the keyring lines, grep finds no match and returns a nonzero status. With set -e, this top-level grep && fail check exits the test before it reaches pass. The autologin and migration checks use the same pattern, so the new test fails on the behavior it is meant to verify. Use if checks for these expected no-match results.

session optional pam_systemd.so
EOF

OMARCHY_SDDM_AUTOLOGIN_PAM="$tmp_dir/sddm-autologin" bash "$migration"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Privileged migration path is untested. This fixture is writable by the test user, so the migration takes the direct sed branch. On an existing installation, the root-owned PAM file takes the sudo sed branch instead. A regression in that production path could leave the autologin delay unfixed while this test passes. A controlled sudo stub would let the test cover that branch.

Knowledge Base Used: Migration framework

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autologin stays on a black screen for ~30s while pam_gnome_keyring blocks the session

3 participants