From nobody@FreeBSD.org  Tue Nov 15 09:51:51 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0CB8216A4E0
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Nov 2005 09:51:51 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7D2B943D45
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Nov 2005 09:51:50 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jAF9pns8079058
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Nov 2005 09:51:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id jAF9pn1w079057;
	Tue, 15 Nov 2005 09:51:49 GMT
	(envelope-from nobody)
Message-Id: <200511150951.jAF9pn1w079057@www.freebsd.org>
Date: Tue, 15 Nov 2005 09:51:49 GMT
From: Vladimir Kotal <vlada@devnull.cz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pfctl parser is too terse when detecting syntax in table specification
X-Send-Pr-Version: www-2.3

>Number:         89058
>Category:       bin
>Synopsis:       [pf] pfctl(8) parser is too terse when detecting syntax in table specification
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-pf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 15 10:00:23 GMT 2005
>Closed-Date:    Tue Nov 15 18:56:28 GMT 2005
>Last-Modified:  Tue Nov 15 19:20:15 GMT 2005
>Originator:     Vladimir Kotal
>Release:        5.4-RELEASE-p7
>Organization:
>Environment:
FreeBSD  5.4-RELEASE-p7 FreeBSD 5.4-RELEASE-p7 #0: Thu Sep  8 19:03:49 UTC 2005     root@cvs:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
              pfctl(8) does not report syntax when a table definition is written incorrectly but does not tell where the syntax error occured.

e.g. with this pf.conf config file:

table <MY_servers>          const { 1.2.3.4, \
                                        4.3.2.1, \
                                        5.5.5.5 }"

it reports 'Syntax error in config file: pf rules not loaded'
because of the quote char but it does not report where the syntax error occured.
It is particulary tedious to find the error in complex rulesets.

>How-To-Repeat:
              use mentioned config file, name it pf.conf-test and run 'pfctl -f pf.conf-test'
>Fix:
             
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-pf 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Nov 15 18:24:18 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89058 
State-Changed-From-To: open->closed 
State-Changed-By: mlaier 
State-Changed-When: Tue Nov 15 18:54:46 GMT 2005 
State-Changed-Why:  
This is fixed in 6.0 and later.  MFC is considered too disruptive for this 
low critical problem.  Possibly pfctl -nvf helps. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89058 

From: =?ISO-8859-1?Q?Vladim=EDr_Kotal?= <vlada@devnull.cz>
To: bug-followup@FreeBSD.org,
 =?ISO-8859-1?Q?Vladim=EDr_Kotal?= <vlada@devnull.cz>
Cc:  
Subject: Re: bin/89058: [pf] pfctl(8) parser is too terse when detecting syntax in table specification
Date: Tue, 15 Nov 2005 20:10:55 +0100

 The -n option does not even report the syntax error help because of 
 this code in pfctl.c:
 
          if (parse_rules(fin, &pf) < 0) {
                  if ((opts & PF_OPT_NOACTION) == 0)
                          ERRX("Syntax error in config file: "
                              "pf rules not loaded");
                  else
                          goto _error;
          }
 
 The -v option does not help either.
 
>Unformatted:
