mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 06:42:51 +01:00
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
This commit is contained in:
parent
812b09037d
commit
b0eefff78b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366576
@ -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 *host,
|
||||
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 */
|
||||
|
Loading…
Reference in New Issue
Block a user