Bug 236614

Summary: blacklistd: fix syslog invocation
Product: Base System Reporter: Helge Oldach <freebsd>
Component: binAssignee: Kurt Lidl <lidl>
Status: Closed FIXED    
Severity: Affects Many People CC: emaste, freebsd, lidl
Priority: --- Keywords: easy, patch
Version: CURRENTFlags: freebsd: mfc-stable12?
freebsd: mfc-stable11?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description Helge Oldach 2019-03-18 08:23:59 UTC
Created attachment 202950 [details]
patch

backlistd uses a function pointer to call the appropriate syslog function in order to support output to stderr. The current code contains a single omission of this logic which is probably a glitch by the author:

Index: blacklistd.c
===================================================================
--- blacklistd.c        (revision 344888)
+++ blacklistd.c        (working copy)
@@ -328,7 +328,7 @@
                if (dbi.id[0]) {
                        run_change("rem", &c, dbi.id, 0);
                        sockaddr_snprintf(buf, sizeof(buf), "%a", ss);
-                       syslog(LOG_INFO, "released %s/%d:%d after %d seconds",
+                       (*lfun)(LOG_INFO, "released %s/%d:%d after %d seconds",
                            buf, c.c_lmask, c.c_port, c.c_duration);
                }
                state_del(state, &c);
Comment 1 Kurt Lidl freebsd_committer freebsd_triage 2019-03-18 15:37:19 UTC
Amusingly enough, I found this same exact problem, and have the same exact fix, while investigating another bug in blacklistd.

The patch looks appropriate.  I'll apply it (as I've already been running the same diff for over a week on my debugging machine).

Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-03-18 15:45:47 UTC
A commit references this bug:

Author: lidl
Date: Mon Mar 18 15:45:07 UTC 2019
New revision: 345276
URL: https://svnweb.freebsd.org/changeset/base/345276

Log:
  Fixup syslog() call that should have used logging function pointer

  PR:		236614
  Submitted by:	Helge Oldach <freebsd@oldach.net>

Changes:
  head/contrib/blacklist/bin/blacklistd.c
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-03-19 02:33:40 UTC
Thanks Kurt

Are stable/{12,11} affected by this warranting MFC?
Comment 4 Helge Oldach 2019-03-19 07:55:17 UTC
(In reply to Kubilay Kocak from comment #3)
Yes, definitely. Please MFC.