diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2013-10-09 16:33:06 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2013-10-09 16:33:06 +0000 |
commit | 956d5d4e261ee8ea7f137811e37ba9e0e8af4c9b (patch) | |
tree | 4660e2adf1d72a34ea88edce765a09386736a536 | |
parent | 585baaefec823eca0f0548cff0c632e58792f18f (diff) |
Trim leading white space from the message before trying to extract
the program name. Works around a problem with the ObiHai 202's
syslog client (and possibly others) where an extra space is added
to the message before the program name. OK krw@ henning@ deraadt@
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 64cf528c253..8b771ca6066 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.107 2013/04/16 19:24:55 deraadt Exp $ */ +/* $OpenBSD: syslogd.c,v 1.108 2013/10/09 16:33:05 millert Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -745,7 +745,9 @@ logmsg(int pri, char *msg, char *from, int flags) prilev = LOG_PRI(pri); /* extract program name */ - for(i = 0; i < NAME_MAX; i++) { + while (isspace(*msg)) + msg++; + for (i = 0; i < NAME_MAX; i++) { if (!isalnum(msg[i]) && msg[i] != '-') break; prog[i] = msg[i]; |