diff options
author | steve <steve@FreeBSD.org> | 1998-06-27 21:45:59 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1998-06-27 21:45:59 +0000 |
commit | 40b850dd415ad2adcddb88549067b23762bce91a (patch) | |
tree | 67fa22a1408026f81982d8c94cad48141e7dd9b0 /usr.sbin/syslogd | |
parent | 5a9ce09142e33ef851523eff668703ad18b0862f (diff) | |
download | FreeBSD-src-40b850dd415ad2adcddb88549067b23762bce91a.zip FreeBSD-src-40b850dd415ad2adcddb88549067b23762bce91a.tar.gz |
Note in log file if messages are being forwarded from a
remote machine.
PR: 7055
Submitted by: Edwin Groothus <edwin@nwm.wan.philips.com>
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index e2fa9af..3ad0d9a 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #endif static const char rcsid[] = - "$Id: syslogd.c,v 1.34 1998/06/24 23:50:20 julian Exp $"; + "$Id: syslogd.c,v 1.35 1998/06/25 19:39:19 guido Exp $"; #endif /* not lint */ /* @@ -796,7 +796,14 @@ fprintlog(f, flags, msg) case F_FORW: dprintf(" %s\n", f->f_un.f_forw.f_hname); - l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", + /* check for local vs remote messages */ + if (strcmp(f->f_prevhost, LocalHostName)) + l = snprintf(line, sizeof line - 1, + "<%d>%.15s Forwarded from %s: %s", + f->f_prevpri, iov[0].iov_base, f->f_prevhost, + iov[4].iov_base); + else + l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", f->f_prevpri, iov[0].iov_base, iov[4].iov_base); if (l > MAXLINE) l = MAXLINE; |