From 62f29f306affa1bc91bb8d8fe2d24e252a0c733f Mon Sep 17 00:00:00 2001 From: David Malone Date: Tue, 28 Dec 2004 21:58:54 +0000 Subject: [PATCH] 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 MFC after: 3 weeks --- usr.sbin/syslogd/syslogd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index e9059b850e6..2dfd1fb0ce8 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -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]; }