allow '*' as a priority
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 1 Oct 1990 09:44:50 +0000 (01:44 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 1 Oct 1990 09:44:50 +0000 (01:44 -0800)
SCCS-vsn: usr.sbin/syslogd/syslogd.c 5.43

usr/src/usr.sbin/syslogd/syslogd.c

index c3d8703..989b125 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)syslogd.c  5.42 (Berkeley) %G%";
+static char sccsid[] = "@(#)syslogd.c  5.43 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -934,7 +934,7 @@ cfline(line, f)
        char *bp;
        int pri;
        struct hostent *hp;
        char *bp;
        int pri;
        struct hostent *hp;
-       char buf[MAXLINE];
+       char buf[MAXLINE], ebuf[100];
 
        dprintf("cfline(%s)\n", line);
 
 
        dprintf("cfline(%s)\n", line);
 
@@ -962,14 +962,16 @@ cfline(line, f)
                        q++;
 
                /* decode priority name */
                        q++;
 
                /* decode priority name */
-               pri = decode(buf, prioritynames);
-               if (pri < 0) {
-                       char xbuf[200];
-
-                       (void) sprintf(xbuf, "unknown priority name \"%s\"",
-                           buf);
-                       logerror(xbuf);
-                       return;
+               if (*buf == '*')
+                       pri = LOG_PRIMASK + 1;
+               else {
+                       pri = decode(buf, prioritynames);
+                       if (pri < 0) {
+                               (void) sprintf(ebuf,
+                                   "unknown priority name \"%s\"", buf);
+                               logerror(ebuf);
+                               return;
+                       }
                }
 
                /* scan facilities */
                }
 
                /* scan facilities */
@@ -983,12 +985,10 @@ cfline(line, f)
                        else {
                                i = decode(buf, facilitynames);
                                if (i < 0) {
                        else {
                                i = decode(buf, facilitynames);
                                if (i < 0) {
-                                       char xbuf[200];
-
-                                       (void) sprintf(xbuf,
+                                       (void) sprintf(ebuf,
                                            "unknown facility name \"%s\"",
                                            buf);
                                            "unknown facility name \"%s\"",
                                            buf);
-                                       logerror(xbuf);
+                                       logerror(ebuf);
                                        return;
                                }
                                f->f_pmask[i >> 3] = pri;
                                        return;
                                }
                                f->f_pmask[i >> 3] = pri;