summaryrefslogtreecommitdiffstats
path: root/auth.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2022-12-09 00:17:40 +0000
committerDarren Tucker <dtucker@dtucker.net>2022-12-09 11:36:27 +1100
commita6183e25e3f1842e21999fe88bc40bb99b121dc3 (patch)
tree7164c061ca9592c421591a0d6cdee4d1d3c973fc /auth.c
parentb85c3581c16aaf6e83b9a797c80705a56b1f312e (diff)
upstream: Add server debugging for hostbased auth.
auth_debug_add queues messages about the auth process which is sent to the client after successful authentication. This also sends those to the server debug log to aid in debugging. From bz#3507, ok djm@ OpenBSD-Commit-ID: 46ff67518cccf9caf47e06393e2a121ee5aa258a
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/auth.c b/auth.c
index 13e8d799..03a777cc 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.158 2022/06/03 04:47:21 djm Exp $ */
+/* $OpenBSD: auth.c,v 1.159 2022/12/09 00:17:40 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -571,14 +571,13 @@ auth_debug_add(const char *fmt,...)
va_list args;
int r;
- if (auth_debug == NULL)
- return;
-
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
- if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0)
- fatal_fr(r, "sshbuf_put_cstring");
+ debug3("%s", buf);
+ if (auth_debug != NULL)
+ if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0)
+ fatal_fr(r, "sshbuf_put_cstring");
}
void