mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 00:04:30 +02:00
Always send any PAM account messages.
If the PAM account stack reaturns any messages, send them to the user not just if the check succeeds. bz#2049, ok djm@
This commit is contained in:
parent
a09e98dcae
commit
ed6bef77f5
6
auth2.c
6
auth2.c
@ -390,10 +390,9 @@ userauth_finish(struct ssh *ssh, int authenticated, const char *method,
|
||||
|
||||
#ifdef USE_PAM
|
||||
if (options.use_pam && authenticated) {
|
||||
int r;
|
||||
int r, success = PRIVSEP(do_pam_account());
|
||||
|
||||
if (!PRIVSEP(do_pam_account())) {
|
||||
/* if PAM returned a message, send it to the user */
|
||||
/* If PAM returned a message, send it to the user. */
|
||||
if (sshbuf_len(loginmsg) > 0) {
|
||||
if ((r = sshbuf_put(loginmsg, "\0", 1)) != 0)
|
||||
fatal("%s: buffer error: %s",
|
||||
@ -404,6 +403,7 @@ userauth_finish(struct ssh *ssh, int authenticated, const char *method,
|
||||
"%s: send PAM banner", __func__);
|
||||
}
|
||||
}
|
||||
if (!success) {
|
||||
fatal("Access denied for user %s by PAM account "
|
||||
"configuration", authctxt->user);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user