>Synopsis: syslogd !!prog fails to send multiple matches
>Category: BASE
>Environment:
System : OpenBSD 7.8
Details : OpenBSD 7.8-current (GENERIC.MP) #194: Wed Jan 7
23:50:10 MST 2026
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
When configuring syslogd to send a specific program to multiple
destinations,
only the first match sends receives the log.
>How-To-Repeat:
Configure syslog.conf with the following at the top of the file
!!program1
*.* /var/log/test1
*.* /var/log/test2
!*
... rest of syslog.conf
Make sure the log files exist
touch /var/log/{test1,test2}
Restart syslogd
rcctl restart syslogd
Now use the logger command to send a syslog message with program of
'program1'
logger -i -p daemon.info -t program1 "test"
Examining the test1 and test2 log files will show that only the test1
log
files has the log line in it.
>Fix:
The patch provided keeps track of the f_quick marking on the
destinations. If
the flag is set and the program/hostname is the same as the previous
log,
then the messaged is logged to the additional matching destination. If
the
next destination program/hostname doesn't match, the logging is
aborted. The
patch is against the current tree as of 2026-01-10.
--- usr.sbin/syslogd/syslogd.c.orig Sat Jan 10 13:50:12 2026
+++ usr.sbin/syslogd/syslogd.c Sat Jan 10 13:52:06 2026
@@ -1807,7 +1807,8 @@
logmsg(struct msg *msg, int flags, char *from)
{
struct filed *f;
- int fac, msglen, prilev;
+ int fac, msglen, prilev, q_flag;
+ char *q_name;
(void)gettimeofday(&now, NULL);
log_debug("logmsg: pri 0%o, flags 0x%x, from %s, prog %s, msg %s",
@@ -1836,8 +1837,18 @@
return;
}
/* log the message to the particular outputs */
+ q_flag = 0;
+ q_name = NULL;
msglen = strlen(msg->m_msg);
SIMPLEQ_FOREACH(f, &Files, f_next) {
+ /* check to see if previous match is quick and name matches
current prog/host */
+ if (q_flag) {
+ /* if no match then we're at the end of the quick
match... so abort */
+ if (!(f->f_program != NULL && strncasecmp(q_name,
f->f_program, strlen(q_name)) == 0) &&
+ !(f->f_hostname != NULL && strncasecmp(q_name,
f->f_hostname, strlen(q_name)) == 0) ) {
+ break;
+ }
+ }
/* skip messages that are incorrect priority */
if (f->f_pmask[fac] < prilev ||
f->f_pmask[fac] == INTERNAL_NOPRI)
@@ -1905,8 +1916,10 @@
}
}
- if (f->f_quick)
- break;
+ if (f->f_quick) {
+ q_flag = 1;
+ q_name = f->f_program != NULL ? f->f_program :
(f->f_hostname != NULL ? f->f_hostname : NULL);
+ }
}
}
dmesg:
OpenBSD 7.8-current (GENERIC.MP) #194: Wed Jan 7 23:50:10 MST 2026
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17036689408 (16247MB)
avail mem = 16493367296 (15729MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xc9754000 (55 entries)
bios0: vendor HP version "N21 Ver. 02.62" date 10/04/2023
bios0: HP HP EliteDesk 800 G2 DM 65W
efi0 at bios0: UEFI 2.4
efi0: HP rev 0x2003e
acpi0 at bios0: ACPI 5.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT TCPA SSDT UEFI SSDT MSDM SLIC WSMT HPET APIC MCFG
SSDT SSDT SSDT DMAR ASF! FPDT BGRT
acpi0: wakeup devices PEG1(S4) PEGP(S4) PEG2(S4) PEGP(S4) PEG0(S4) PEGP(S4)
GLAN(S4) XHC_(S3) XDCI(S4) HDAS(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4)
RP03(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 23999999 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 3192.56 MHz, 06-5e-03, patch
000000f0
cpu0: cpuid 1
edx=bfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
ecx=77fafbff<SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND>
cpu0: cpuid 6 eax=27f7<SENSOR,ARAT,PTS> ecx=9<EFFFREQ>
cpu0: cpuid 7.0
ebx=29c6fbf<FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT>
edx=bc002e00<SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD>
cpu0: cpuid a vers=4, gp=8, gpwidth=48, ff=3, ffwidth=48
cpu0: cpuid d.1 eax=f<XSAVEOPT,XSAVEC,XGETBV1,XSAVES>
cpu0: cpuid 80000001 edx=2c100800<NXE,PAGE1GB,RDTSCP,LONG>
ecx=121<LAHF,ABM,3DNOWP>
cpu0: cpuid 80000007 edx=100<ITSC>
cpu0: msr 10a=c04<RSBA,MISC_PKG_CT,ENERGY_FILT>
cpu0: MELTDOWN
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB 64b/line
4-way L2 cache, 6MB 64b/line 12-way L3 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 3192.56 MHz, 06-5e-03, patch
000000f0
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 3192.56 MHz, 06-5e-03, patch
000000f0
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz, 3192.56 MHz, 06-5e-03, patch
000000f0
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xf8000000, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG1)
acpiprt2 at acpi0: bus -1 (PEG2)
acpiprt3 at acpi0: bus -1 (PEG0)
acpiprt4 at acpi0: bus -1 (RP01)
acpiprt5 at acpi0: bus -1 (RP02)
acpiprt6 at acpi0: bus -1 (RP03)
acpiprt7 at acpi0: bus -1 (RP04)
acpiprt8 at acpi0: bus -1 (RP05)
acpiprt9 at acpi0: bus 1 (RP06)
acpiprt10 at acpi0: bus -1 (RP07)
acpiprt11 at acpi0: bus -1 (RP08)
acpiprt12 at acpi0: bus 2 (RP09)
acpiprt13 at acpi0: bus -1 (RP10)
acpiprt14 at acpi0: bus -1 (RP11)
acpiprt15 at acpi0: bus -1 (RP12)
acpiprt16 at acpi0: bus -1 (RP13)
acpiprt17 at acpi0: bus -1 (RP14)
acpiprt18 at acpi0: bus -1 (RP15)
acpiprt19 at acpi0: bus -1 (RP16)
acpiprt20 at acpi0: bus -1 (RP17)
acpiprt21 at acpi0: bus -1 (RP18)
acpiprt22 at acpi0: bus -1 (RP19)
acpiprt23 at acpi0: bus -1 (RP20)
acpiec0 at acpi0: not present
acpiec1 at acpi0
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001
acpicmos0 at acpi0
"PNP0A06" at acpi0 not configured
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
"PNP0C14" at acpi0 not configured
intelpmc0 at acpi0: PEPD
tpm0 at acpi0 TPM_ 1.2 (TIS) addr 0xfed40000/0x5000, device 0x001b15d1 rev 0x10
acpicpu0 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C3(200@256 mwait.1@0x40), C2(200@151 mwait.1@0x33),
C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PG01, resource for PEG1
acpipwrres1 at acpi0: PG02, resource for PEG2
acpipwrres2 at acpi0: PG00, resource for PEG0
acpipwrres3 at acpi0: WRST
acpipwrres4 at acpi0: WRST
acpipwrres5 at acpi0: WRST
acpipwrres6 at acpi0: WRST
acpipwrres7 at acpi0: WRST
acpipwrres8 at acpi0: WRST
acpipwrres9 at acpi0: WRST
acpipwrres10 at acpi0: WRST
acpipwrres11 at acpi0: WRST
acpipwrres12 at acpi0: WRST
acpipwrres13 at acpi0: WRST
acpipwrres14 at acpi0: WRST
acpipwrres15 at acpi0: WRST
acpipwrres16 at acpi0: WRST
acpipwrres17 at acpi0: WRST
acpipwrres18 at acpi0: WRST
acpipwrres19 at acpi0: WRST
acpipwrres20 at acpi0: WRST
acpipwrres21 at acpi0: WRST
acpipwrres22 at acpi0: WRST
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: using VERW MDS workaround (except on vmm entry)
cpu0: Enhanced SpeedStep 3192 MHz: speeds: 3201, 3200, 3000, 2900, 2700, 2500,
2300, 2200, 2000, 1800, 1700, 1500, 1300, 1100, 1000, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 6G Host" rev 0x07
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 530" rev 0x06
drm0 at inteldrm0
inteldrm0: msi, SKYLAKE, gen 9
xhci0 at pci0 dev 20 function 0 "Intel 100 Series xHCI" rev 0x31: msi, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00
addr 1
pchtemp0 at pci0 dev 20 function 2 "Intel 100 Series Thermal" rev 0x31
"Intel 100 Series MEI" rev 0x31 at pci0 dev 22 function 0 not configured
puc0 at pci0 dev 22 function 3 "Intel 100 Series KT" rev 0x31: ports: 16 com
com4 at puc0 port 0 apic 2 int 19: ns16550a, 16 byte fifo
ahci0 at pci0 dev 23 function 0 "Intel 100 Series AHCI" rev 0x31: msi, AHCI
1.3.1
ahci0: PHY offline on port 0
ahci0: PHY offline on port 1
ahci0: PHY offline on port 2
ahci0: PHY offline on port 3
ahci0: PHY offline on port 4
scsibus1 at ahci0: 32 targets
ppb0 at pci0 dev 28 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci1 at ppb0 bus 1
iwm0 at pci1 dev 0 function 0 "Intel AC 8260" rev 0x3a, msi
ppb1 at pci0 dev 29 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci2 at ppb1 bus 2
nvme0 at pci2 dev 0 function 0 "Samsung SM961/PM961" rev 0x00: msix, NVMe 1.2
nvme0: SAMSUNG MZVLW256HEHP-000H1, firmware CXB73H1Q, serial S340NX0K811923
scsibus2 at nvme0: 2 targets, initiator 0
sd0 at scsibus2 targ 1 lun 0: <NVMe, SAMSUNG MZVLW256, CXB7>
sd0: 244198MB, 512 bytes/sector, 500118192 sectors
pcib0 at pci0 dev 31 function 0 "Intel Q170 LPC" rev 0x31
"Intel 100 Series PMC" rev 0x31 at pci0 dev 31 function 2 not configured
azalia0 at pci0 dev 31 function 3 "Intel 100 Series HD Audio" rev 0x31: msi
azalia0: codecs: Realtek ALC221, Intel/0x2809, using Realtek ALC221
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 100 Series SMBus" rev 0x31: apic 2 int
16
iic0 at ichiic0
em0 at pci0 dev 31 function 6 "Intel I219-LM" rev 0x31: msi, address
fc:3f:db:11:5c:d9
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb at mainbus0 not configured
uhidev0 at uhub0 port 4 configuration 1 interface 0 "Logitech USB Receiver" rev
2.00/5.03 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
uhidev1 at uhub0 port 4 configuration 1 interface 1 "Logitech USB Receiver" rev
2.00/5.03 addr 2
uhidev1: iclass 3/1, 11 report ids
ums0 at uhidev1 reportid 2: 16 buttons, Z and W dir
wsmouse0 at ums0 mux 0
ucc0 at uhidev1 reportid 3: 767 usages, 20 keys, array
wskbd2 at ucc0 mux 1
uhid0 at uhidev1 reportid 4: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 11: input=2, output=0, feature=0
uhidev2 at uhub0 port 4 configuration 1 interface 2 "Logitech USB Receiver" rev
2.00/5.03 addr 2
uhidev2: iclass 3/0, 17 report ids
uhidpp0 at uhidev2 device 1 keyboard "MX MCHNCL", device 2 mouse "MX Ergo S"
uhidev3 at uhub0 port 4 configuration 1 interface 3 "Logitech USB Receiver" rev
2.00/5.03 addr 2
uhidev3: iclass 3/0, 42 report ids
uhid2 at uhidev3 reportid 40: input=28, output=0, feature=0
uhid3 at uhidev3 reportid 41: input=0, output=0, feature=1
uhid4 at uhidev3 reportid 42: input=0, output=0, feature=256
ugen0 at uhub0 port 7 "Intel Bluetooth" rev 2.00/0.01 addr 3
uaudio0 at uhub0 port 13 configuration 1 interface 1 "Plantronics Plantronics
BT600" rev 2.00/21.20 addr 4
uaudio0: class v1, full-speed, sync, channels: 2 play, 1 rec, 3 ctls
audio1 at uaudio0
uhidev4 at uhub0 port 13 configuration 1 interface 3 "Plantronics Plantronics
BT600" rev 2.00/21.20 addr 4
uhidev4: iclass 3/0, 35 report ids
uhid5 at uhidev4 reportid 1: input=1, output=1, feature=0
uhid6 at uhidev4 reportid 2: input=0, output=1, feature=0
uhid7 at uhidev4 reportid 3: input=0, output=1, feature=0
uhid8 at uhidev4 reportid 4: input=0, output=1, feature=0
uhid9 at uhidev4 reportid 5: input=0, output=1, feature=0
uhid10 at uhidev4 reportid 6: input=1, output=1, feature=1
uhid11 at uhidev4 reportid 7: input=63, output=63, feature=0
uhid12 at uhidev4 reportid 8: input=0, output=1, feature=0
uhid13 at uhidev4 reportid 9: input=1, output=1, feature=1
uhid14 at uhidev4 reportid 10: input=2, output=1, feature=0
uhid15 at uhidev4 reportid 11: input=1, output=0, feature=1
uhid16 at uhidev4 reportid 12: input=0, output=0, feature=2
uhid17 at uhidev4 reportid 13: input=0, output=1, feature=1
uhid18 at uhidev4 reportid 14: input=1, output=1, feature=0
uhid19 at uhidev4 reportid 15: input=0, output=1, feature=0
uhid20 at uhidev4 reportid 17: input=0, output=0, feature=1
uhid21 at uhidev4 reportid 18: input=0, output=0, feature=1
uhid22 at uhidev4 reportid 19: input=0, output=1, feature=0
uhid23 at uhidev4 reportid 20: input=0, output=1, feature=0
uhid24 at uhidev4 reportid 21: input=2, output=0, feature=0
uhid25 at uhidev4 reportid 22: input=63, output=63, feature=0
uhid26 at uhidev4 reportid 24: input=1, output=1, feature=1
uhid27 at uhidev4 reportid 25: input=0, output=1, feature=0
uhid28 at uhidev4 reportid 26: input=0, output=1, feature=0
uhid29 at uhidev4 reportid 27: input=0, output=1, feature=0
uhid30 at uhidev4 reportid 28: input=0, output=1, feature=0
uhid31 at uhidev4 reportid 29: input=1, output=1, feature=1
uhid32 at uhidev4 reportid 30: input=1, output=0, feature=1
ucc1 at uhidev4 reportid 31: 11 usages, 7 keys, enum
wskbd3 at ucc1 mux 1
uhid33 at uhidev4 reportid 35: input=0, output=1, feature=1
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (b8eefc5073745ed1.a) swap on sd0b dump on sd0b
inteldrm0: 1920x1080, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wskbd2: connecting to wsdisplay0
wskbd3: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
iwm0: hw rev 0x200, fw ver 36.ca7b901d.0, address e4:b3:18:af:b8:a6
usbdevs:
Controller /dev/usb0:
addr 01: 8086:0000 Intel, xHCI root hub
super speed, self powered, config 1, rev 1.00
driver: uhub0
addr 02: 046d:c548 Logitech, USB Receiver
full speed, power 98 mA, config 1, rev 5.03
driver: uhidev0
driver: uhidev1
driver: uhidev2
driver: uhidev3
addr 03: 8087:0a2b Intel, Bluetooth
full speed, self powered, config 1, rev 0.01
driver: ugen0
addr 04: 047f:02ee Plantronics, Plantronics BT600
full speed, power 100 mA, config 1, rev 21.20, iSerial
d3b07cb447cabb4f921dfe847de37e49
driver: uaudio0
driver: uhidev4