Page MenuHomeFreeBSD

syslogd: fixed hostname processing and optimizing timestamp parsing for RFC 5424
ClosedPublic

Authored by dmitry.wagin_ya.ru on Oct 2 2020, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 5, 7:07 AM
Unknown Object (File)
Mon, Jun 24, 3:12 PM
Unknown Object (File)
May 14 2024, 3:50 PM
Unknown Object (File)
Apr 26 2024, 10:06 AM
Unknown Object (File)
Apr 26 2024, 10:06 AM
Unknown Object (File)
Apr 26 2024, 9:57 AM
Unknown Object (File)
Apr 26 2024, 9:57 AM
Unknown Object (File)
Apr 26 2024, 2:44 AM
Subscribers

Details

Summary

In RFC 3164 (bsd-format): The Domain Name MUST NOT be included in the HOSTNAME field.
In RFC 5424 (ietf-format): The HOSTNAME field SHOULD contain the hostname and the domain name of the originator in FQDN format.

Without these changes syslogd(8) uses trimdomain() for addresses received from socket by socklist_recv_sock() (via cvthname()) and addresses used by config filtering by readconfigfile() (via cfline()).

Also, RFC 5424 timestamp parsing has been optimized.

Test Plan

Hostname filtering works incorrectly with "-O syslog" in next cases:

  • using "+@" filtering - "localhost" (without domain name) is used for comparing with FQDN-names (ex. "localhost.localdomain");
  • using "+server.localdomain" filtering, "-H" flag and localdomain clients - "server" (without domain name) is used for comparing with FQDN-names (ex. "bsd.localdomain").

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks reasonable to me, thanks. Please be sure to upload with context, this change is hard to read without it. i.e., generate the raw diff with -U99999.

This revision is now accepted and ready to land.Oct 3 2020, 5:54 PM
This revision now requires review to proceed.Oct 4 2020, 2:46 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 9 2020, 3:19 PM
This revision was automatically updated to reflect the committed changes.