Bug 236614 - blacklistd: fix syslog invocation
Summary: blacklistd: fix syslog invocation
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Kurt Lidl
Keywords: easy, patch
Depends on:
Reported: 2019-03-18 08:23 UTC by Helge Oldach
Modified: 2019-03-19 07:56 UTC (History)
3 users (show)

See Also:
freebsd: mfc-stable12?
freebsd: mfc-stable11?

patch (482 bytes, patch)
2019-03-18 08:23 UTC, Helge Oldach
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Oldach 2019-03-18 08:23:59 UTC
Created attachment 202950 [details]

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 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).

Comment 2 commit-hook freebsd_committer 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

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

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

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.