summaryrefslogtreecommitdiff
path: root/auth1.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth1.c')
-rw-r--r--auth1.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/auth1.c b/auth1.c
index 3f93b9869..2a9d18b9a 100644
--- a/auth1.c
+++ b/auth1.c
@@ -25,9 +25,11 @@ RCSID("$OpenBSD: auth1.c,v 1.59 2004/07/28 09:40:29 markus Exp $");
25#include "session.h" 25#include "session.h"
26#include "uidswap.h" 26#include "uidswap.h"
27#include "monitor_wrap.h" 27#include "monitor_wrap.h"
28#include "buffer.h"
28 29
29/* import */ 30/* import */
30extern ServerOptions options; 31extern ServerOptions options;
32extern Buffer loginmsg;
31 33
32/* 34/*
33 * convert ssh auth msg type into description 35 * convert ssh auth msg type into description
@@ -251,8 +253,23 @@ do_authloop(Authctxt *authctxt)
251 253
252#ifdef USE_PAM 254#ifdef USE_PAM
253 if (options.use_pam && authenticated && 255 if (options.use_pam && authenticated &&
254 !PRIVSEP(do_pam_account())) 256 !PRIVSEP(do_pam_account())) {
255 authenticated = 0; 257 char *msg;
258 size_t len;
259
260 error("Access denied for user %s by PAM account "
261 "configuration", authctxt->user);
262 len = buffer_len(&loginmsg);
263 buffer_append(&loginmsg, "\0", 1);
264 msg = buffer_ptr(&loginmsg);
265 /* strip trailing newlines */
266 if (len > 0)
267 while (len > 0 && msg[--len] == '\n')
268 msg[len] = '\0';
269 else
270 msg = "Access denied.";
271 packet_disconnect(msg);
272 }
256#endif 273#endif
257 274
258 /* Log before sending the reply */ 275 /* Log before sending the reply */