anyone?
On 05/19/2011 03:31 PM, Florian Obser wrote:
> Hi,
> 
> I'm not sure if this is a bug or a feature. Consider the following pf.conf:
> 
> # foo
> # bar 
> 
> #pass out \
> pass out log \
>   label "foo#bar"\
>   tag "FOO#BAZ"
> 
> 
> pass out \
>   label "foo#bar"\
>   tag FOO#BAZ
> 
> # /sbin/pfctl -vv -nf /home/florian/pf.conf                 
> @0 pass out all flags S/SA keep state label "foo#bar" tag FOO
> 
> The comment "#pass out \" continues to tag "FOO#BAZ" and the first rule is
> removed.
> 
> If this is considered a bug the attached patch fixes this:
> 
> # /usr/src/sbin/pfctl/obj/pfctl -vv -nf /home/florian/pf.conf       
> @0 pass out log all flags S/SA keep state label "foo#bar" tag FOO#BAZ
> @1 pass out all flags S/SA keep state label "foo#bar" tag FOO
> 
> The patch contains fixes for all parse.y mentioned in 
> 
> http://marc.info/?l=openbsd-cvs&m=128086103506497&w=2
> 
> Additionally there is a patch for parse.y for xenocara app/cwm, mentioned
> here: http://marc.info/?l=openbsd-cvs&m=128544524209247&w=2
> 
> I currently have no build infrastructure for xenocara and don't use cwm so
> that patch is completly untested.
> 
> Base compiles with the patch and we tested pfctl and bgpd, with help
> from Sebastian Benoit who tested bgpd.
> 
> Note that this patch might change the behaviour of pf and all the
> other daemons.
> 
> If it is a feature, note that pf.conf(5) talks about comments:
>      Comments can be put anywhere in the file using a hash mark (`#'), and
>      extend to the end of the current line.
> 
> but doesn't explain the semantics of continuation lines. I don't feel
> qualified to provide a patch for pf.conf(5).
> 
> ~ Florian
> 
> Index: sbin/iked/parse.y
> ===================================================================
> RCS file: /cvs/src/sbin/iked/parse.y,v
> retrieving revision 1.21
> diff -u -r1.21 parse.y
> --- sbin/iked/parse.y 18 Apr 2011 08:45:43 -0000      1.21
> +++ sbin/iked/parse.y 18 May 2011 22:33:34 -0000
> @@ -1132,6 +1132,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -1188,9 +1192,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: sbin/ipsecctl/parse.y
> ===================================================================
> RCS file: /cvs/src/sbin/ipsecctl/parse.y,v
> retrieving revision 1.150
> diff -u -r1.150 parse.y
> --- sbin/ipsecctl/parse.y     6 Oct 2010 22:19:20 -0000       1.150
> +++ sbin/ipsecctl/parse.y     18 May 2011 22:33:40 -0000
> @@ -1036,6 +1036,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -1092,9 +1096,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: sbin/pfctl/parse.y
> ===================================================================
> RCS file: /cvs/src/sbin/pfctl/parse.y,v
> retrieving revision 1.599
> diff -u -r1.599 parse.y
> --- sbin/pfctl/parse.y        6 Apr 2011 13:19:55 -0000       1.599
> +++ sbin/pfctl/parse.y        18 May 2011 22:33:51 -0000
> @@ -5226,6 +5226,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -5282,9 +5286,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/bgpd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/parse.y,v
> retrieving revision 1.259
> diff -u -r1.259 parse.y
> --- usr.sbin/bgpd/parse.y     1 May 2011 12:56:04 -0000       1.259
> +++ usr.sbin/bgpd/parse.y     18 May 2011 22:33:58 -0000
> @@ -2261,6 +2261,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -2317,9 +2321,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/btctl/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/btctl/parse.y,v
> retrieving revision 1.7
> diff -u -r1.7 parse.y
> --- usr.sbin/btctl/parse.y    3 Aug 2010 18:42:40 -0000       1.7
> +++ usr.sbin/btctl/parse.y    18 May 2011 22:34:00 -0000
> @@ -321,6 +321,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -376,9 +380,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>  
>       switch (c) {
>       case '\'':
> Index: usr.sbin/btd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/btd/parse.y,v
> retrieving revision 1.3
> diff -u -r1.3 parse.y
> --- usr.sbin/btd/parse.y      3 Aug 2010 18:42:40 -0000       1.3
> +++ usr.sbin/btd/parse.y      18 May 2011 22:34:03 -0000
> @@ -293,6 +293,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -348,9 +352,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>  
>       switch (c) {
>       case '\'':
> Index: usr.sbin/dvmrpd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/dvmrpd/parse.y,v
> retrieving revision 1.22
> diff -u -r1.22 parse.y
> --- usr.sbin/dvmrpd/parse.y   31 Dec 2010 21:22:42 -0000      1.22
> +++ usr.sbin/dvmrpd/parse.y   18 May 2011 22:34:05 -0000
> @@ -457,6 +457,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -513,9 +517,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/hostapd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/hostapd/parse.y,v
> retrieving revision 1.43
> diff -u -r1.43 parse.y
> --- usr.sbin/hostapd/parse.y  3 Aug 2010 18:42:40 -0000       1.43
> +++ usr.sbin/hostapd/parse.y  18 May 2011 22:34:09 -0000
> @@ -1375,6 +1375,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -1431,9 +1435,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ifstated/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ifstated/parse.y,v
> retrieving revision 1.30
> diff -u -r1.30 parse.y
> --- usr.sbin/ifstated/parse.y 3 Aug 2010 18:42:40 -0000       1.30
> +++ usr.sbin/ifstated/parse.y 18 May 2011 22:34:11 -0000
> @@ -455,6 +455,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -511,9 +515,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ldapd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldapd/parse.y,v
> retrieving revision 1.10
> diff -u -r1.10 parse.y
> --- usr.sbin/ldapd/parse.y    18 Oct 2010 13:29:49 -0000      1.10
> +++ usr.sbin/ldapd/parse.y    18 May 2011 22:34:14 -0000
> @@ -508,6 +508,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -564,9 +568,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ldpd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldpd/parse.y,v
> retrieving revision 1.7
> diff -u -r1.7 parse.y
> --- usr.sbin/ldpd/parse.y     1 Sep 2010 13:54:54 -0000       1.7
> +++ usr.sbin/ldpd/parse.y     18 May 2011 22:34:17 -0000
> @@ -422,6 +422,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -476,9 +480,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ntpd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ntpd/parse.y,v
> retrieving revision 1.47
> diff -u -r1.47 parse.y
> --- usr.sbin/ntpd/parse.y     3 Aug 2010 18:42:40 -0000       1.47
> +++ usr.sbin/ntpd/parse.y     18 May 2011 22:34:19 -0000
> @@ -394,6 +394,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -449,9 +453,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>  
>       switch (c) {
>       case '\'':
> Index: usr.sbin/ospf6d/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ospf6d/parse.y,v
> retrieving revision 1.20
> diff -u -r1.20 parse.y
> --- usr.sbin/ospf6d/parse.y   13 Dec 2010 13:43:37 -0000      1.20
> +++ usr.sbin/ospf6d/parse.y   18 May 2011 22:34:22 -0000
> @@ -608,6 +608,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -664,9 +668,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ospfd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ospfd/parse.y,v
> retrieving revision 1.73
> diff -u -r1.73 parse.y
> --- usr.sbin/ospfd/parse.y    13 Dec 2010 13:43:37 -0000      1.73
> +++ usr.sbin/ospfd/parse.y    18 May 2011 22:34:25 -0000
> @@ -811,6 +811,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -867,9 +871,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/relayd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/relayd/parse.y,v
> retrieving revision 1.155
> diff -u -r1.155 parse.y
> --- usr.sbin/relayd/parse.y   9 May 2011 12:08:47 -0000       1.155
> +++ usr.sbin/relayd/parse.y   18 May 2011 22:34:31 -0000
> @@ -1888,6 +1888,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -1944,9 +1948,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ripd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ripd/parse.y,v
> retrieving revision 1.28
> diff -u -r1.28 parse.y
> --- usr.sbin/ripd/parse.y     3 Aug 2010 18:42:41 -0000       1.28
> +++ usr.sbin/ripd/parse.y     18 May 2011 22:34:35 -0000
> @@ -480,6 +480,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -536,9 +540,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/smtpd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/smtpd/parse.y,v
> retrieving revision 1.73
> diff -u -r1.73 parse.y
> --- usr.sbin/smtpd/parse.y    1 May 2011 12:57:11 -0000       1.73
> +++ usr.sbin/smtpd/parse.y    18 May 2011 22:34:40 -0000
> @@ -1193,6 +1193,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -1247,9 +1251,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/snmpd/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v
> retrieving revision 1.20
> diff -u -r1.20 parse.y
> --- usr.sbin/snmpd/parse.y    21 Apr 2011 14:55:22 -0000      1.20
> +++ usr.sbin/snmpd/parse.y    18 May 2011 22:34:43 -0000
> @@ -488,6 +488,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -544,9 +548,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> Index: usr.sbin/ypldap/parse.y
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ypldap/parse.y,v
> retrieving revision 1.9
> diff -u -r1.9 parse.y
> --- usr.sbin/ypldap/parse.y   3 Aug 2010 18:42:41 -0000       1.9
> +++ usr.sbin/ypldap/parse.y   18 May 2011 22:34:46 -0000
> @@ -437,6 +437,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -493,9 +497,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>       if (c == '$' && parsebuf == NULL) {
>               while (1) {
>                       if ((c = lgetc(0)) == EOF)
> 
> ----------------------------------------------------------------------
> 
> --- parse.y~  Thu May 19 00:39:26 2011
> +++ parse.y   Thu May 19 00:39:26 2011
> @@ -294,6 +294,10 @@
>                       return (EOF);
>               c = getc(file->stream);
>       }
> +
> +     if (c == '#')
> +             while ((c = getc(file->stream)) != '\n' && c != EOF)
> +                     ; /* nothing */
>       return (c);
>  }
>  
> @@ -347,9 +351,6 @@
>               ; /* nothing */
>  
>       yylval.lineno = file->lineno;
> -     if (c == '#')
> -             while ((c = lgetc(0)) != '\n' && c != EOF)
> -                     ; /* nothing */
>  
>       switch (c) {
>       case '\'':
> 


-- 
I remember yesterday, but the memory is in my head now.
Was yesterday real? Or is it only the memory that is real?

Reply via email to