Hi,

The +host feature allows to select log messages from a specific
host.  Normally syslogd does a reverse lookup on the sender's
address.  If that fails or if syslogd has been started with the -n
option, the +host is matched with the IP.  Unfortunatelty IP addresses
consist of characters that are not allowed in syslog.conf.  So take
the list of valid characters from FreeBSD.

ok?

bluhm

Index: usr.sbin/syslogd/syslogd.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.179
diff -u -p -r1.179 syslogd.c
--- usr.sbin/syslogd/syslogd.c  27 Aug 2015 17:53:35 -0000      1.179
+++ usr.sbin/syslogd/syslogd.c  28 Aug 2015 16:07:43 -0000
@@ -2053,12 +2053,13 @@ init(void)
                                continue;
                        }
                        for (i = 0; i < NAME_MAX; i++) {
-                               if (!isalnum((unsigned char)p[i]) &&
-                                   p[i] != '-' && p[i] != '+')
+                               if (!isalnum((unsigned char)*p) &&
+                                   *p != '-' && *p != '+' && *p != '.' &&
+                                   *p != ',' && *p != ':' && *p != '%')
                                        break;
-                               hostblock[i] = p[i];
+                               hostblock[i] = *p++;
                        }
-                       hostblock[i] = 0;
+                       hostblock[i] = '\0';
                        continue;
                }
 

Reply via email to