Bug 241269

Summary: syslogd fails to log anything if there is a unicode character in the hostname of a machine
Product: Base System Reporter: Sverre <sverre.eldoy>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: cem, emaste, freebsd, yuripv
Priority: ---    
Version: 12.0-RELEASE   
Hardware: Any   
OS: Any   

Description Sverre 2019-10-15 13:59:56 UTC
I have this machine that has a single unicode character (a monkey) as it's hostname.. In the past this has worked quite well but now syslogd doesn't log anything at all. I am not 100% sure when the regression happened, but I suspect it was around February this year. 

Turning on the debug-flag I see the screen filling up with:
Failed to parse HOSTNAME from and then every single line of output that should have been logged. 

I suspect this might happen to anybody that has a funky character in their hostname.
Comment 1 Yuri Pankov freebsd_committer freebsd_triage 2019-10-17 06:19:02 UTC
Which exactly character (code) is the problem?
Comment 2 Sverre 2019-10-18 17:13:32 UTC
(In reply to Yuri Pankov from comment #1)
🐒
Comment 3 Sverre 2019-10-18 17:14:03 UTC
(In reply to Sverre from comment #2)
The hostname is 🐒.domain.blah
Comment 4 Sverre 2019-11-01 14:47:43 UTC
Actually it seems that it's enough to have some emoji char in your hostname - it doesn't have to be all emoji... so awef🐒awef.domain.blah will also make syslogd fail to log... I think it's the part where it strips out "dangerous characters" that is the culprit,.. Compiling a version without that check now to see if that works.
Comment 5 Sverre 2019-11-01 15:45:43 UTC
It doesn't actually have to be an emoji either.. ℬ, ⨊, ... even the norwegian letters like å,æ,ø makes it fail.. and the swedish variants ä, ö .. It's a nice way to disable all logging if you got root on a box: just switch your hostname to something that has a  weird character in it and there is basically no trace of anything you do on it.