mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 12:28:58 +00:00
Some syslog messages delimit the program tag with whitespace rather
than a colon, so don't allow whitespace in program names. To be consistent with hostnames, don't allow whitespace in the program name specifiers in syslog.conf either. (The first change is by Markus from the PR, the second is mine.) PR: 68691 Submitted by: Markus Oestreicher <m.oe@x-trader.de> MFC after: 3 weeks
This commit is contained in:
parent
7f456a7d61
commit
62f29f306a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=139381
@ -921,7 +921,7 @@ logmsg(int pri, const char *msg, const char *from, int flags)
|
||||
/* extract program name */
|
||||
for (i = 0; i < NAME_MAX; i++) {
|
||||
if (!isprint(msg[i]) || msg[i] == ':' || msg[i] == '[' ||
|
||||
msg[i] == '/')
|
||||
msg[i] == '/' || isspace(msg[i]))
|
||||
break;
|
||||
prog[i] = msg[i];
|
||||
}
|
||||
@ -1608,7 +1608,7 @@ init(int signo)
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < NAME_MAX; i++) {
|
||||
if (!isprint(p[i]))
|
||||
if (!isprint(p[i]) || isspace(p[i]))
|
||||
break;
|
||||
prog[i] = p[i];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user