summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-12-04 06:49:20 +0000
committerjkh <jkh@FreeBSD.org>1998-12-04 06:49:20 +0000
commit20107e8f4764aa3175f409771cda14a671f81324 (patch)
tree60b14453bcd79710ed994636168fac4b679e1bc0 /usr.sbin
parent7da0628e5519c77b2818b30342209fc1fc878815 (diff)
downloadFreeBSD-src-20107e8f4764aa3175f409771cda14a671f81324.zip
FreeBSD-src-20107e8f4764aa3175f409771cda14a671f81324.tar.gz
Allow either tabs or spaces in configuration files.
PR: 8762 Submitted by: Igor Roshchin <str@giganda.komkon.org>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syslogd/syslog.conf.516
-rw-r--r--usr.sbin/syslogd/syslogd.c16
2 files changed, 22 insertions, 10 deletions
diff --git a/usr.sbin/syslogd/syslog.conf.5 b/usr.sbin/syslogd/syslog.conf.5
index 4b07d75..a2ddf5f 100644
--- a/usr.sbin/syslogd/syslog.conf.5
+++ b/usr.sbin/syslogd/syslog.conf.5
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93
-.\" $Id: syslog.conf.5,v 1.10 1998/06/10 04:34:54 julian Exp $
+.\" $Id: syslog.conf.5,v 1.11 1998/07/22 06:15:16 phk Exp $
.\"
.Dd June 9, 1993
.Dt SYSLOG.CONF 5
@@ -62,7 +62,19 @@ The
.Em selector
field is separated from the
.Em action
-field by one or more tab characters.
+field by one or more tab characters or spaces.
+.Pp
+Note that if you use spaces as separators, your
+.Em syslog.conf
+might be incompatible with other Unices or Unix-like systems.
+This functionality was added for the ease of configuration
+(e.g. it is possible to cut-and-paste into
+.Em syslog.conf
+),
+and to avoid possible mistakes. This change however preserves
+backwards compatibility with the old style of the
+.Em syslog.conf
+(i.e. tab characters only).
.Pp
The
.Em Selectors
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 66d33c3..685adaf 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.41 1998/08/25 21:16:47 julian Exp $";
+ "$Id: syslogd.c,v 1.42 1998/11/05 10:51:21 dg Exp $";
#endif /* not lint */
/*
@@ -1366,12 +1366,12 @@ cfline(line, f, prog)
}
/* scan through the list of selectors */
- for (p = line; *p && *p != '\t';) {
+ for (p = line; *p && *p != '\t' && *p != ' ';) {
int pri_done;
int pri_cmp;
/* find the end of this facility name list */
- for (q = p; *q && *q != '\t' && *q++ != '.'; )
+ for (q = p; *q && *q != '\t' && *q != ' ' && *q++ != '.'; )
continue;
/* get the priority comparison */
@@ -1403,12 +1403,12 @@ cfline(line, f, prog)
;
/* collect priority name */
- for (bp = buf; *q && !strchr("\t,;", *q); )
+ for (bp = buf; *q && !strchr("\t,; ", *q); )
*bp++ = *q++;
*bp = '\0';
/* skip cruft */
- while (strchr(", ;", *q))
+ while (strchr(",;", *q))
q++;
/* decode priority name */
@@ -1425,8 +1425,8 @@ cfline(line, f, prog)
}
/* scan facilities */
- while (*p && !strchr("\t.;", *p)) {
- for (bp = buf; *p && !strchr("\t,;.", *p); )
+ while (*p && !strchr("\t.; ", *p)) {
+ for (bp = buf; *p && !strchr("\t,;. ", *p); )
*bp++ = *p++;
*bp = '\0';
@@ -1455,7 +1455,7 @@ cfline(line, f, prog)
}
/* skip to action part */
- while (*p == '\t')
+ while (*p == '\t' || *p == ' ')
p++;
switch (*p)
OpenPOWER on IntegriCloud