standards/169697: syslogd(8) is not BOM aware
Volodymyr Kostyrko
c.kworr at gmail.com
Sat Jul 7 15:00:24 UTC 2012
>Number: 169697
>Category: standards
>Synopsis: syslogd(8) is not BOM aware
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-standards
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Jul 07 15:00:23 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Volodymyr Kostyrko
>Release: RELENG_9
>Organization:
None
>Environment:
# uname -a
FreeBSD limbo.xim.bz 9.0-STABLE FreeBSD 9.0-STABLE #2 r238059M: Tue Jul 3 15:27:12 EEST 2012 arcade at limbo.xim.bz:/usr/obj/usr/src/sys/MINIMALx32 i386
>Description:
Sending a UTF-8 formatted string starting with BOM to syslogd via /dev/log almost works:
#!/usr/bin/evn python
from __future__ import unicode_literals
import logging, logging.handlers
logger = logging.getLogger('test')
handler = logging.handlers.SysLogHandler('/dev/log')
handler.setFormatter(logging.Formatter('%(name)s[%(process)s]: %(message)s'))
logger.addHandler(handler)
logger.critical('test')
This results in following line in log:
Jul 7 17:31:19 limbo test[9154]: test
But hexdump of it shows:
00000000 4a 75 6c 20 20 37 20 31 37 3a 32 37 3a 32 37 20 |Jul 7 17:27:27 |
00000010 6c 69 6d 62 6f 20 ef bb bf 74 65 73 74 5b 35 36 |limbo ...test[56|
00000020 37 33 5d 3a 20 74 65 73 74 0a |73]: test.|
0000002a
Note the BOM before logger name. It account as part of name, and such messages can't be rerouted via /etc/syslogd.conf as they just doesn't match. Including BOM field into the logs is also not a good thing.
>How-To-Repeat:
>Fix:
I think BOM can be safely dropped if:
- line starts with BOM;
- '-8' switch is given.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-standards
mailing list