Properly respect the passed in hostname for RFC 5424 messages.
Only override the hostname in case none is provided or when remote hostnames should be ignored.
This commit is contained in:
parent
e0f92f5c77
commit
10b154332d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332110
@ -1028,6 +1028,8 @@ parsemsg_rfc5424(const char *from, int pri, char *msg)
|
|||||||
msg[-1] = '\0'; \
|
msg[-1] = '\0'; \
|
||||||
}
|
}
|
||||||
PARSE_STRING("HOSTNAME", hostname);
|
PARSE_STRING("HOSTNAME", hostname);
|
||||||
|
if (hostname == NULL || !RemoteHostname)
|
||||||
|
hostname = from;
|
||||||
PARSE_STRING("APP-NAME", app_name);
|
PARSE_STRING("APP-NAME", app_name);
|
||||||
PARSE_STRING("PROCID", procid);
|
PARSE_STRING("PROCID", procid);
|
||||||
PARSE_STRING("MSGID", msgid);
|
PARSE_STRING("MSGID", msgid);
|
||||||
@ -1079,7 +1081,7 @@ parsemsg_rfc5424(const char *from, int pri, char *msg)
|
|||||||
#undef IF_NOT_NILVALUE
|
#undef IF_NOT_NILVALUE
|
||||||
|
|
||||||
parsemsg_remove_unsafe_characters(msg, line, sizeof(line));
|
parsemsg_remove_unsafe_characters(msg, line, sizeof(line));
|
||||||
logmsg(pri, timestamp, from, app_name, procid, msgid,
|
logmsg(pri, timestamp, hostname, app_name, procid, msgid,
|
||||||
structured_data, line, 0);
|
structured_data, line, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user