diff options
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r-- | usr.sbin/syslogd/Makefile.depend | 21 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslog.conf.5 | 10 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 21 |
3 files changed, 46 insertions, 6 deletions
diff --git a/usr.sbin/syslogd/Makefile.depend b/usr.sbin/syslogd/Makefile.depend new file mode 100644 index 0000000..c262920 --- /dev/null +++ b/usr.sbin/syslogd/Makefile.depend @@ -0,0 +1,21 @@ +# Autogenerated - do NOT edit! + +DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} + +DEP_MACHINE := ${.PARSEFILE:E} + +DIRDEPS = \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libutil \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.sbin/syslogd/syslog.conf.5 b/usr.sbin/syslogd/syslog.conf.5 index f9d4024..3378aa0 100644 --- a/usr.sbin/syslogd/syslog.conf.5 +++ b/usr.sbin/syslogd/syslog.conf.5 @@ -28,7 +28,7 @@ .\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd September 12, 2012 .Dt SYSLOG.CONF 5 .Os .Sh NAME @@ -347,6 +347,14 @@ If a port number is added after a colon .Pq Ql :\& then that port will be used as the destination port rather than the usual syslog port. +IPv6 addresses can be used +by surrounding the address portion with +square brackets +.Po +.Ql [\& +and +.Ql ]\& +.Pc . .It A comma separated list of users. Selected messages are written to those users diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d1c9fd1..fff7e4c 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -312,7 +312,7 @@ static void cfline(const char *, struct filed *, static const char *cvthname(struct sockaddr *); static void deadq_enter(pid_t, const char *); static int deadq_remove(pid_t); -static int decode(const char *, CODE *); +static int decode(const char *, const CODE *); static void die(int); static void dodie(int); static void dofsync(void); @@ -1123,7 +1123,7 @@ fprintlog(struct filed *f, int flags, const char *msg) char p_n[5]; /* Hollow laugh */ if (LogFacPri > 1) { - CODE *c; + const CODE *c; for (c = facilitynames; c->c_name; c++) { if (c->c_val == fac) { @@ -1931,6 +1931,7 @@ cfline(const char *line, struct filed *f, const char *prog, const char *host) case '@': { char *tp; + char endkey = ':'; /* * scan forward to see if there is a port defined. * so we can't use strlcpy.. @@ -1939,9 +1940,19 @@ cfline(const char *line, struct filed *f, const char *prog, const char *host) tp = f->f_un.f_forw.f_hname; p++; - while (*p && (*p != ':') && (i-- > 0)) { + /* + * an ipv6 address should start with a '[' in that case + * we should scan for a ']' + */ + if (*p == '[') { + p++; + endkey = ']'; + } + while (*p && (*p != endkey) && (i-- > 0)) { *tp++ = *p++; } + if (endkey == ']' && *p == endkey) + p++; *tp = '\0'; } /* See if we copied a domain and have a port */ @@ -2018,9 +2029,9 @@ cfline(const char *line, struct filed *f, const char *prog, const char *host) * Decode a symbolic name to a numeric value */ static int -decode(const char *name, CODE *codetab) +decode(const char *name, const CODE *codetab) { - CODE *c; + const CODE *c; char *p, buf[40]; if (isdigit(*name)) |