Date: Thu, 19 Nov 1998 11:16:06 -0500 (EST) From: Igor Roshchin <str@giganda.komkon.org> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/8762: syslogd.conf shell accept spaces in addition to TABs Message-ID: <199811191616.LAA24067@giganda.komkon.org>
next in thread | raw e-mail | index | archive | help
>Number: 8762
>Category: bin
>Synopsis: syslogd.conf shell accept spaces in addition to TABs
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Nov 19 08:20:00 PST 1998
>Last-Modified:
>Originator: Igor Roshchin
>Organization:
KomKon
>Release: FreeBSD 2.2.7-RELEASE i386
>Environment:
>Description:
As discussed on freebsd-security and freebsd-current,
having spaces accepted by syslogd in syslog.conf
will simplify life of many admins.
At the same time the backwards compatibility is preserved
>How-To-Repeat:
>Fix:
--- syslogd.c.orig Thu Aug 6 00:58:10 1998
+++ syslogd.c Thu Oct 8 22:19:27 1998
@@ -1365,12 +1365,12 @@
}
/* 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 */
@@ -1402,12 +1402,12 @@
;
/* 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 */
@@ -1424,8 +1424,8 @@
}
/* 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';
@@ -1454,7 +1454,7 @@
}
/* skip to action part */
- while (*p == '\t')
+ while (*p == '\t' || *p == ' ')
p++;
switch (*p)
--- syslog.conf.5.orig Thu Aug 6 00:58:10 1998
+++ syslog.conf.5 Wed Oct 14 20:17:40 1998
@@ -62,7 +62,19 @@
.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
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811191616.LAA24067>
