Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 1997 12:44:03 -0800 (PST)
From:      Archie Cobbs <archie@whistle.com>
To:        dk+@ua.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Teeny-weeny /usr/src/sbin/ipfw/ipfw.c patch
Message-ID:  <199712052044.MAA22727@bubba.whistle.com>
In-Reply-To: <199712050606.WAA23987@dog.farm.org> from Dmitry Kohmanyuk at "Dec 4, 97 10:06:37 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Dmitry Kohmanyuk writes:
> >   
> > + 			if (*buf == '#')
> > + 				continue;
> 
> 	should probably become
> 			
> 			char *p;
> 			if ((p = strchr(buf, '#')) != NULL)
> 				*p = 0;
> 
> 	to handle lines like
>      #indented comment
>      	or
> ipfw deny .... ...   #end-of-line comment

I almost agree with you, but not quite :-)

The reason is that you never know when a # might become a valid
part of an ipfw command.

An an example, mpd used to do this for comments in the config files.
Then somebody wanted to put a '#' in their password:

  set password "a&xq#53F"

and suddenly they couldn't login... Not a perfect counter-example,
but the idea is ... you never know.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712052044.MAA22727>