From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 12 00:20:04 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39E64106566B for ; Thu, 12 Mar 2009 00:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 26D9F8FC0A for ; Thu, 12 Mar 2009 00:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n2C0K36d089862 for ; Thu, 12 Mar 2009 00:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n2C0K3Tn089861; Thu, 12 Mar 2009 00:20:03 GMT (envelope-from gnats) Date: Thu, 12 Mar 2009 00:20:03 GMT Message-Id: <200903120020.n2C0K3Tn089861@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Christoph Weber-Fahr Cc: Subject: Re: misc/132553: ipfw doesnt understand ftp-data port X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Christoph Weber-Fahr List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2009 00:20:04 -0000 The following reply was made to PR misc/132553; it has been noted by GNATS. From: Christoph Weber-Fahr To: Maxim Konovalov Cc: bug-followup@FreeBSD.org Subject: Re: misc/132553: ipfw doesnt understand ftp-data port Date: Wed, 11 Mar 2009 23:35:03 +0100 Hello, Maxim Konovalov wrote: >> # ipfw add 1770 allow tcp from any to any ftp-data keep-state >> >> but now it produces >> >> ipfw: unrecognised option [-1] ftp-data [...] > $ ipfw -n add 1770 allow tcp from any to any ftp\\-data keep-state > > 01770 allow tcp from any to any dst-port 20 keep-state > > works for me. Two problems with that: 1. it is neither obvious nor documented that you need to escape the minus. The manpage says you can use names from /etc/services. No restrictions. The minus sign is not a shell token either, so ipfw gets it as it is. Furthermore, ipfw can handle minus signs on various parts of its syntax tree, so its not a general problem. So there is no reason for the plain user to escape that. Actually, even though it might be obvious to you, I have no clue why actually escaping is necessary now when it wasn't needed before. 2. it breaks compatibility with older firewall scripts. I ran against that when migrating a larger firewall rule set from freebsd 4.x to 6.x. That line worked quite nicely in freebsd 4.x. (don't know about 5.x) So I suggest fixing it, or, at least, document the problem in the man page. Regards Christoph Weber-Fahr