fix(nb): order pam_sss ahead of pam_unix in the password stack #306
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!306
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "lab/20260808-1423"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #305, found while running the M1 spikes from #301.
The defect
A password change at the SDDM greeter asks for the old password twice and the new password twice:
pam_chauthtok()runs the password stack in two passes —PAM_PRELIM_CHECK, thenPAM_UPDATE_AUTHTOK— and both modules prompt in each, becausepam_ssscarries nouse_authtok(unlikepam_gnome_keyringbelow it, which does):pam_unix(10200)old password:pam_sss(10900)old password:pam_unixnew password:/retype:pam_sssnew password:/retype:pam_unixcan never succeed for these accounts.hosts/nb/modules/ldap-login.nix:120-122declares identity-tenant users locally with no password on purpose, so SDDM lists them in its getpwent()-built user list and pam_unix falls through to pam_sss. That is right for authentication — but in chauthtok it means a module that is structurally incapable of helping interrogates the user twice before giving up.The fix
Order
pam_sssahead ofpam_unixso it short-circuits assufficientandpam_unixis never reached. Three prompts instead of six.Local accounts are unaffected:
pam_sssreturnsUSER_UNKNOWN, which for asufficientrule falls through topam_unixexactly as today.mkForceis required because the default order comes fromutils.pam.autoOrderRules, which assigns it at config level and asserts the rule does not already carry one.Targets
security.pam.services.loginonly. SDDM setsuseDefaultRules = falseand its stack isinclude login— already noted atldap-login.nix:133-135— so this covers the greeter and TTY paths together.Not a double write
Worth stating explicitly: across a full doubled-prompt sequence the principal key version stepped 4 -> 5, not 4 -> 6, and
Last modifiedshowed a singlekadmind@CLOONAR.COMentry. Only one change ever reached the KDC. This is a prompting defect, not a correctness one.Caveats for the reviewer
nix-instantiatenot found), soscripts/test-configuration nbcould not run and the commit used--no-verify. A bad evaluation would failnixos-rebuild buildin bento and the host would simply not switch, but the diff has not been evaluated.10100is chosen to sit belowunixat10200; both values were read off the rendered/etc/pam.d/loginonnb.security.pam.services.passwd, which likely has the same shape. Deliberately left alone — setting.orderon a service whosesssrule does not exist would create a rule with nomodulePath. Worth checking/etc/pam.d/passwdseparately.What to look for when testing
Expect three prompts (old, new, retype) and
getprincshowingAttributes:empty with kvno stepped by exactly one. Also confirm localdominikcan still change its password normally — that is the regression this could plausibly cause.Refs #301, #299.