From a05e7777f7f79e4b71ebbb8edd6e48ae30d94047 Mon Sep 17 00:00:00 2001 From: bluhm Date: Wed, 4 May 2022 14:47:46 +0000 Subject: [PATCH] Variable pri is uninitialized, use msg.m_pri instead. This affects the priority of userland messages with kernel or unspecified facility. broken in previous commit; fix from markus@ --- usr.sbin/syslogd/syslogd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d44b311ae16..4942a89ee71 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.273 2022/01/13 10:34:07 martijn Exp $ */ +/* $OpenBSD: syslogd.c,v 1.274 2022/05/04 14:47:46 bluhm Exp $ */ /* * Copyright (c) 2014-2021 Alexander Bluhm @@ -1562,7 +1562,6 @@ usage(void) void printline(char *hname, char *msgstr) { - int pri; struct msg msg; char *p, *q, line[LOG_MAXLINE + 4 + 1]; /* message, encoding, NUL */ @@ -1584,7 +1583,7 @@ printline(char *hname, char *msgstr) * messages with no facility specified. */ if (LOG_FAC(msg.m_pri) == LOG_KERN) - msg.m_pri = LOG_USER | LOG_PRI(pri); + msg.m_pri = LOG_USER | LOG_PRI(msg.m_pri); if (msg.m_timestamp[0] == '\0') current_time(msg.m_timestamp); -- 2.20.1