[Bug 273402] syslog(3) silently drops message when openlog(3) contains spaces in "ident" text

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 28 Aug 2023 15:36:59 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273402

            Bug ID: 273402
           Summary: syslog(3) silently drops message when openlog(3)
                    contains spaces in "ident" text
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: nelson@msu.edu

Verified as failing under 13.2-RELEASE; verified as working under 11.2-RELEASE

As of FreeBSD 13.2, the openlog() call is applying semantics to the "ident"
argument. This action is not documented - the "man" page states that "ident" is
a string prepended to the syslog text; in earlier versions, this was exactly
the treatment.  In 13.2, if the "ident" text contains two words, it is
reformatted into "word1[word2]; if it contains more than two space-separated
words, all subsequent "syslog" messages are silently dropped.

I was able to reproduce this from the command line, using the "logger" utility:

logger 'My test message'                                               
logger -t testing 'My test message'                                            
logger -t 'testing 123' 'My test message'                                       
logger -t 'testing 123 456' 'My test message'                                   

Results under FreeBSD 11.2:

Aug 28 11:21:22 netman1-old Rden: My test message
Aug 28 11:21:35 netman1-old testing: My test message
Aug 28 11:21:39 netman1-old testing 123: My test message
Aug 28 11:21:45 netman1-old testing 123 456: My test message

Results under FreeBSD 13.2:

Aug 28 11:19:53 netman1-dev Rden[63807]: My test message
Aug 28 11:20:02 netman1-dev testing[63813]: My test message
Aug 28 11:20:12 netman1-dev testing[123]: - My test message
(4th "logger" call is silently dropped)

-- 
You are receiving this mail because:
You are the assignee for the bug.