properly bail out when PAM changes username

OpenSSH doesn't support PAM changing its conception of the
username via a module calling pam_set_item(h, PAM_USER, ...).
We were supposed to bail out here, but I messed up while "fixing"
this last time and dropped a return statement.

Reported by Mike Damm
This commit is contained in:
Damien Miller committed 2026-04-02 18:32:00 +11:00
1 parent fe86c39751
commit 5d72f1865b
1 file changed
+1
+1
View File
@@ -474,6 +474,7 @@ check_pam_user(Authctxt *authctxt)
if (strcmp(sshpam_initial_user, pam_user) != 0) {
error_f("PAM user \"%s\" does not match previous \"%s\"",
pam_user, sshpam_initial_user);
return PAM_USER_UNKNOWN;
}
return PAM_SUCCESS;
}