troglobit / sysklogd

BSD syslog daemon with syslog()/syslogp() API replacement for Linux, RFC3164 + RFC5424
https://troglobit.com/sysklogd.html
Other
93 stars 20 forks source link

Garbled process name in std log file output #57

Closed troglobit closed 2 years ago

troglobit commented 2 years ago

Since sysklogd v2.4.1, with the introduction of 50f6ad7, std (RFC3164) log file output look like this:

Aug 12 11:46:19 anarchy @���@@: random: crng init done
Aug 12 11:46:19 anarchy @���@[1]: Starting sysklogd[415]
Aug 12 11:46:19 anarchy @@-1A[416]: network: udhcpc: started, v1.35.0 
Aug 12 11:46:19 anarchy @@��E@: 8021q: adding VLAN 0 to HW filter on device eth0
Aug 12 11:46:19 anarchy @@��E[1]: myLinux 2022.05-981-geda5590fa9, entering runlevel 2
Aug 12 11:46:19 anarchy @@N'G[1]: Starting dropbear[437]

Turns out the introduced change (copy-paste almost from libsyslog) was not properly tested. Using a stack variable for the composed process tag does not work since the stack buffer goes out of scope.