summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-07-10 19:39:52 +1000
committerDamien Miller <djm@mindrot.org>2018-07-10 19:39:52 +1000
commit120a1ec74e8d9d29f4eb9a27972ddd22351ddef9 (patch)
tree52308557de781f1d8ffb083369e0c209bc305c02 /auth2.c
parent0f3958c1e6ffb8ea4ba27e2a97a00326fce23246 (diff)
Adapt portable to legacy buffer API removal
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/auth2.c b/auth2.c
index c3ae56051..a6e82f7a3 100644
--- a/auth2.c
+++ b/auth2.c
@@ -50,7 +50,8 @@
50#include "auth.h" 50#include "auth.h"
51#include "dispatch.h" 51#include "dispatch.h"
52#include "pathnames.h" 52#include "pathnames.h"
53#include "buffer.h" 53#include "sshbuf.h"
54#include "ssherr.h"
54 55
55#ifdef GSSAPI 56#ifdef GSSAPI
56#include "ssh-gss.h" 57#include "ssh-gss.h"
@@ -63,7 +64,7 @@
63extern ServerOptions options; 64extern ServerOptions options;
64extern u_char *session_id2; 65extern u_char *session_id2;
65extern u_int session_id2_len; 66extern u_int session_id2_len;
66extern Buffer loginmsg; 67extern struct sshbuf *loginmsg;
67 68
68/* methods */ 69/* methods */
69 70
@@ -378,11 +379,15 @@ userauth_finish(struct ssh *ssh, int authenticated, const char *method,
378 379
379#ifdef USE_PAM 380#ifdef USE_PAM
380 if (options.use_pam && authenticated) { 381 if (options.use_pam && authenticated) {
382 int r;
383
381 if (!PRIVSEP(do_pam_account())) { 384 if (!PRIVSEP(do_pam_account())) {
382 /* if PAM returned a message, send it to the user */ 385 /* if PAM returned a message, send it to the user */
383 if (buffer_len(&loginmsg) > 0) { 386 if (sshbuf_len(loginmsg) > 0) {
384 buffer_append(&loginmsg, "\0", 1); 387 if ((r = sshbuf_put(loginmsg, "\0", 1)) != 0)
385 userauth_send_banner(buffer_ptr(&loginmsg)); 388 fatal("%s: buffer error: %s",
389 __func__, ssh_err(r));
390 userauth_send_banner(sshbuf_ptr(loginmsg));
386 packet_write_wait(); 391 packet_write_wait();
387 } 392 }
388 fatal("Access denied for user %s by PAM account " 393 fatal("Access denied for user %s by PAM account "