From owner-svn-src-all@freebsd.org Thu Aug 9 15:48:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7272A106A9C4; Thu, 9 Aug 2018 15:48:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE2AE7AB38; Thu, 9 Aug 2018 15:48:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Fm8jG018169; Thu, 9 Aug 2018 08:48:08 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79Fm8Ed018168; Thu, 9 Aug 2018 08:48:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 08:48:08 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 15:48:12 -0000 > On 09.08.2018 17:40, Rodney W. Grimes wrote: > >>> So now I can not code a quiet ipfw command that does fail when > >>> I give it a bad delete command :-(. > >> > >> Previously -q did not handled by delete command, so you can just use bad > >> "ipfw delete" without -q :) > > > > This now means -q has 2 functions, silence most commands, > > and silently ignore errors on delete. > > > > That is a poor implementation of syntax and options. > > I think it makes "delete" command to have the same behavior as described > for commands in "-q" description: Which is yet another bug in your commit, you did not update the synopsis or the description of the -q flag to include your change. Though oddly the synopsis does show delete -q, it how ever does not show -q for any of the table commands. > > -q Be quiet when executing the add, nat, zero, resetlog or flush > commands; (implies -f). No mention of what it does on delete, does -q on delete imply -f? > This is useful when updating rulesets by > executing multiple ipfw commands in a script (e.g., > ?sh?/etc/rc.firewall?), or by processing a file with many ipfw > rules across a remote login session. It also stops a table add > or delete from failing if the entry already exists or is not > present. That suggesting that -q is good for remote login session is poor advice at best, you should redirect both standard and error output to a file, depending on -q is just a loaded gun waiting to go off. > > table add/delete commands had the same behavior, "nat" already noted in > this list. What is the usage scenario do you use, where you need to fail > on bad delete? if [ ipfw delete ${1} ]; then handle the missing rule fi But more importantly you seem to be ignoring the aspect that your overloading a "silent" option with a "ignore failure" option. That is bad design. The description of the -q flag is already 2x as long as it should be in a good design. -- Rod Grimes rgrimes@freebsd.org