diff options
author | markus@openbsd.org <markus@openbsd.org> | 2021-04-15 18:24:31 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-04-16 05:24:33 +0200 |
commit | faf2b86a46c9281d237bcdec18c99e94a4eb820a (patch) | |
tree | 31f662f8992fcde2c429d3cb6619f0be6349ae27 /monitor.c | |
parent | sshd don't exit on transient read errors (diff) | |
download | openssh-faf2b86a46c9281d237bcdec18c99e94a4eb820a.tar.xz openssh-faf2b86a46c9281d237bcdec18c99e94a4eb820a.zip |
upstream: do not pass file/func to monitor; noted by Ilja van Sprundel;
ok djm@
OpenBSD-Commit-ID: 85ae5c063845c410283cbdce685515dcd19479fa
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.224 2021/03/03 22:41:49 djm Exp $ */ +/* $OpenBSD: monitor.c,v 1.225 2021/04/15 16:24:31 markus Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * Copyright 2002 Markus Friedl <markus@openbsd.org> @@ -417,8 +417,8 @@ static int monitor_read_log(struct monitor *pmonitor) { struct sshbuf *logmsg; - u_int len, level, line; - char *msg, *file, *func; + u_int len, level, forced; + char *msg; u_char *p; int r; @@ -449,21 +449,17 @@ monitor_read_log(struct monitor *pmonitor) fatal_fr(r, "reserve msg"); if (atomicio(read, pmonitor->m_log_recvfd, p, len) != len) fatal_f("log fd read: %s", strerror(errno)); - if ((r = sshbuf_get_cstring(logmsg, &file, NULL)) != 0 || - (r = sshbuf_get_cstring(logmsg, &func, NULL)) != 0 || - (r = sshbuf_get_u32(logmsg, &line)) != 0 || - (r = sshbuf_get_u32(logmsg, &level)) != 0 || + if ((r = sshbuf_get_u32(logmsg, &level)) != 0 || + (r = sshbuf_get_u32(logmsg, &forced)) != 0 || (r = sshbuf_get_cstring(logmsg, &msg, NULL)) != 0) fatal_fr(r, "parse"); /* Log it */ if (log_level_name(level) == NULL) fatal_f("invalid log level %u (corrupted message?)", level); - sshlog(file, func, line, 0, level, NULL, "%s [preauth]", msg); + sshlogdirect(level, forced, "%s [preauth]", msg); sshbuf_free(logmsg); - free(file); - free(func); free(msg); return 0; |