Re: pf.conf comment lines

Previous thread: Votre cadeau est arrivé by Toner Service - Cartouches d'encre on Friday, June 13, 2008 - 12:25 am. (1 message)

Next thread: gnupg to add LDAP - how? by macintoshzoom on Friday, June 13, 2008 - 8:52 am. (2 messages)
To: <misc@...>
Date: Friday, June 13, 2008 - 8:09 am

Hi,

I am running OpenBSD 4.3 STABLE in an i386 machine.

The man page for pf.conf says at some point:

"Any lines beginning with a # are treated as comments and ignored."

Now, if a comment line ends with "\", should the next line
be also treated as comment? I noticed this behaviour and I do
not know whether or not it should work like that.

Many times, when we are trying to test a different setup, we
duplicate a line, change something, and comment out the
original line.

Thanks in advance.

Regards,

Jose

--
See Exclusive Videos: 10th Annual Young Hollywood Awards
http://www.hollywoodlife.net/younghollywoodawards2008/

To: Jose Fragoso <inet_user23@...>
Cc: <misc@...>
Date: Friday, June 13, 2008 - 3:14 pm

Yes, pf.conf(5) says that about the table files.

About the main pf.conf(5) file itself, it says:

Comments can be put anywhere in the file using a hash mark (`#'), and ex-

Well, because you used \ to end the line, that # is not at the start of a
line. It is in the middle of a split line. And the previously described

Well, the result is predictable.

To: Theo de Raadt <deraadt@...>
Cc: <misc@...>
Date: Saturday, June 14, 2008 - 12:05 am

On Fri, Jun 13, 2008 at 1:14 PM, Theo de Raadt <deraadt@cvs.openbsd.org> wrote:

Sadly, this varies among languages and file-formats. You just have to
know how the one you're working in behaves.

Languages and file-formats where comment removal occurs before
backslash-newline removal:
sh
csh
perl
python
awk
/etc/sudoers
/etc/ipsec.conf

Languages and file-formats where backslash-newline removal occurs
before comment removal:
tcl
C
C++
getcap(3)-style files
/etc/pf.conf

Philip Guenther

To: Philip Guenther <guenther@...>
Cc: Theo de Raadt <deraadt@...>, <misc@...>
Date: Saturday, June 14, 2008 - 10:58 am

So, when in doubt, comment every line that needs to be comment out,
should work in almost all cases?

--
This e-mail may be confidential. You may not copy, forward,
distribute, or, use any part of it. Note, this text has no effective
legal binding on your part. There is no obligation to abide any or all
parts of this, just as any texts appended to e-mail on rest of the
Internet. For more information about disclaimers, please see:
http://www.goldmark.org/jeff/stupid-disclaimers/

To: Sunnz <sunnzy@...>
Cc: <misc@...>
Date: Saturday, June 14, 2008 - 2:03 pm

The ambiguous case is a comment line that ends with a backslash, so
commenting out all the lines in a group of continued lines works in
all cases, yes.

(Beware how you phrase things: "comment every line that needs to be
comment[ed] out" is a tautology, as the meaning of "needs to be
commented out" depends on the file format, which isn't what you wanted
to ask...)

Philip Guenther

To: Jose Fragoso <inet_user23@...>
Cc: <misc@...>
Date: Friday, June 13, 2008 - 8:55 am

Interesting. Good to know that. In a small rule set it's easy to
notice, though.

I'm able to duplicate the behavior on 4.3 GENERIC#698 i386: comment
lines ending with backslash *are* including the subsequent line(s) as
part of the comment.

Regards,
-Lars

Previous thread: Votre cadeau est arrivé by Toner Service - Cartouches d'encre on Friday, June 13, 2008 - 12:25 am. (1 message)

Next thread: gnupg to add LDAP - how? by macintoshzoom on Friday, June 13, 2008 - 8:52 am. (2 messages)