Date: Fri, 9 Oct 2020 15:19:29 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366576 - head/usr.sbin/syslogd Message-ID: <202010091519.099FJTtR043608@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Fri Oct 9 15:19:29 2020 New Revision: 366576 URL: https://svnweb.freebsd.org/changeset/base/366576 Log: syslogd: Avoid trimming host names in RFC 5424 mode RFC 5424 says that implementations should log hostnames in FQDN format. Only trim host names in RFC 3164 mode. PR: 250014 Submitted by: Dmitry Wagin <dmitry.wagin@ya.ru> MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26644 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Oct 9 15:14:19 2020 (r366575) +++ head/usr.sbin/syslogd/syslogd.c Fri Oct 9 15:19:29 2020 (r366576) @@ -2300,7 +2300,9 @@ cvthname(struct sockaddr *f) hl = strlen(hname); if (hl > 0 && hname[hl-1] == '.') hname[--hl] = '\0'; - trimdomain(hname, hl); + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + trimdomain(hname, hl); return (hname); } @@ -2927,7 +2929,9 @@ cfline(const char *line, const char *prog, const char hl = strlen(f->f_host); if (hl > 0 && f->f_host[hl-1] == '.') f->f_host[--hl] = '\0'; - trimdomain(f->f_host, hl); + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + trimdomain(f->f_host, hl); } /* save program name if any */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010091519.099FJTtR043608>