diff options
author | David Malone <dwmalone@FreeBSD.org> | 2000-10-17 10:19:42 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2000-10-17 10:19:42 +0000 |
commit | 481a19023efa8bdf97d748e8595e5370a90603fa (patch) | |
tree | b390cab315e2b98e5b2fa644032708c76d5b9460 /usr.sbin/syslogd/syslogd.c | |
parent | bcfe1db87d7bdea83da2167305e2daacff4ccf4e (diff) | |
download | src-481a19023efa8bdf97d748e8595e5370a90603fa.tar.gz src-481a19023efa8bdf97d748e8595e5370a90603fa.zip |
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>
Notes
Notes:
svn path=/head/; revision=67249
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 b1f2f776eb9a..4cdf5b421f75 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; |