diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2000-10-17 10:19:42 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2000-10-17 10:19:42 +0000 |
commit | 40ef4e01131bb27bd327dd28719e2421be16d518 (patch) | |
tree | d5cc45a4135b3bed6fc6a54222789160947daa31 /usr.sbin/syslogd/syslogd.c | |
parent | 78d7baf25126bec309420164937de57a711761e1 (diff) | |
download | FreeBSD-src-40ef4e01131bb27bd327dd28719e2421be16d518.zip FreeBSD-src-40ef4e01131bb27bd327dd28719e2421be16d518.tar.gz |
Syslogd normally converts messages of facility kern to facility
user unless they come directly from the kernel. Document this and
add a flag to syslogd which prevents this conversion.
Sort getopt args while I'm at it.
PR: 21788
Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index b1f2f77..4cdf5b4 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -269,6 +269,7 @@ int NumAllowed = 0; /* # of AllowedPeer entries */ int UniquePriority = 0; /* Only log specified priority? */ int LogFacPri = 0; /* Put facility and priority in log message: */ /* 0=no, 1=numeric, 2=names */ +int KeepKernFac = 0; /* Keep remotely logged kernel facility */ int allowaddr __P((char *)); void cfline __P((char *, struct filed *, char *, char *)); @@ -311,7 +312,7 @@ main(argc, argv) pid_t ppid = 1; socklen_t len; - while ((ch = getopt(argc, argv, "a:dl:f:m:p:nsuv")) != -1) + while ((ch = getopt(argc, argv, "a:df:kl:m:np:suv")) != -1) switch (ch) { case 'a': /* allow specific network addresses only */ if (allowaddr(optarg) == -1) @@ -323,6 +324,9 @@ main(argc, argv) case 'f': /* configuration file */ ConfFile = optarg; break; + case 'k': /* keep remote kern fac */ + KeepKernFac = 1; + break; case 'l': if (nfunix < MAXFUNIX) funixn[nfunix++] = optarg; @@ -580,7 +584,7 @@ printline(hname, msg) pri = DEFUPRI; /* don't allow users to log kernel messages */ - if (LOG_FAC(pri) == LOG_KERN) + if (LOG_FAC(pri) == LOG_KERN && !KeepKernFac) pri = LOG_MAKEPRI(LOG_USER, LOG_PRI(pri)); q = line; |