Package: rsyslog
Version: 8.2102.0-2+deb11u1
Severity: minor

Using the attached rsyslog.conf, with this test log:

    /usr/bin/printf 'TEST BYTES 
\xc3\xb1\xc3\x28\xa0\xa1\xe2\x82\xa1\xe2\x28\xa1\xe2\x82\x28\xf0\x90\x8c\xbc\xf0\x28\x8c\xbc\xf0\x90\x28\xbc\xf0\x28\x8c\x28\xf8\xa1\xa1\xa1\xa1\xfc\xa1\xa1\xa1\xa1\xa1'
 | logger -p auth.0 -t invalid-utf8-test

...I find that mmutf8fix has fixed auth.log, but not the emergency
event printed to logged-in terminals.

I *guess* this is because omusrmsg uses "properties" instead of "the message"?

    Note that once it has been called, it actually modifies the message.
    The original messsage is then no longer available.
    However, this DOES NOT CHANGE ANY PROPERTIES set, used or extracted before 
the modification is done.

    
https://rsyslog.readthedocs.io/en/latest/configuration/modules/mmutf8fix.html


This issue doesn't really bother me, but
it would be nice if it was explicitly mentioned in the documentation, e.g.

    For example, omusrmsg will not be affected, because
    it uses properties (ignored by mmutf8fix) and ignores the message (fixed by 
mmutf8fix).



-- System Information:
Debian Release: 11.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.18.0-0.deb11.4-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
$umask 0022
$WorkDirectory /var/spool/rsyslog
$MaxOpenFiles 20000

module(load="imuxsock")
module(load="imklog")
module(load="imudp")
module(load="imrelp")
input(type="imudp" port="514")
input(type="imrelp" port="2514" KeepAlive="on")

module(load="mmutf8fix")
action(type="mmutf8fix")

template(name="PrisonPCFileFormat" type="list") {
    property(name="timegenerated" dateFormat="rfc3339")
    constant(value=" ")
    property(name="hostname")
    constant(value=" ")
    property(name="syslogtag" field.delimiter="58" field.number="1")
    constant(value=":")
    property(name="msg" spifno1stsp="on")
    property(name="msg" droplastlf="on")
    constant(value="\n")
    }

module(load="builtin:omfile"
       template="PrisonPCFileFormat"
       dirCreateMode="0755"
       fileCreateMode="0640"
       fileOwner="root"
       fileGroup="adm")

if ($syslogfacility-text == "auth" or $syslogfacility-text == "authpriv") then {
    action(type="omfile"
           file="/var/log/auth.log"
           sync="off"
           asyncWriting="on"
           flushInterval="1"
           ioBufferSize="128K")
} else {
    action(type="omfile"
           file="/var/log/syslog"
           sync="off"
           asyncWriting="on"
           flushInterval="5"
           ioBufferSize="128K")
}

if ($syslogpriority-text == "emerg") then {
    action(type="omusrmsg" users="*")
}

$IncludeConfig /etc/rsyslog.d/*.conf

Reply via email to