From owner-freebsd-audit Thu Jan 23 8:10:52 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87E0E37B405; Thu, 23 Jan 2003 08:10:49 -0800 (PST) Received: from relay1.macomnet.ru (relay1.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4952343F18; Thu, 23 Jan 2003 08:10:47 -0800 (PST) (envelope-from maxim@FreeBSD.org) Received: from news1.macomnet.ru (news1.macomnet.ru [195.128.64.14]) by relay1.macomnet.ru (8.11.6/8.11.6) with ESMTP id h0NGAka9573524; Thu, 23 Jan 2003 19:10:46 +0300 (MSK) Date: Thu, 23 Jan 2003 19:10:46 +0300 (MSK) From: Maxim Konovalov To: Giorgos Keramidas Cc: freebsd-audit@FreeBSD.org, "" , "" Subject: Re: (fwd) bin/47196: ipfw won't format correctly output from 'ipfw show' command In-Reply-To: <20030123034022.GA587@gothmog.gr> Message-ID: <20030123184329.T77556@news1.macomnet.ru> References: <20030123034022.GA587@gothmog.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Giorgos, On 05:40+0200, Jan 23, 2003, Giorgos Keramidas wrote: > Hi folks, > > I've sent the following 2 days ago to ipfw@ but received no reply. > Does anyone feel like testing/reviewing or committing this? This > change should be all we need to fix & close PR bin/47196 :-) Formatting was broken in rev. 1.103 ipfw.c in -CURRENT and ipfw2 in -CURRENT and -STABLE inherited the bug later. I think we should rever this part of rev. 1.103 of ipfw.c in ipfw2.c: Index: ipfw/ipfw2.c =================================================================== RCS file: /home/ncvs/src/sbin/ipfw/ipfw2.c,v retrieving revision 1.21 diff -u -r1.21 ipfw2.c --- ipfw/ipfw2.c 12 Jan 2003 03:31:10 -0000 1.21 +++ ipfw/ipfw2.c 23 Jan 2003 16:07:09 -0000 @@ -823,7 +823,7 @@ printf("%05u ", rule->rulenum); if (do_acct) - printf("%10qu %10qu ", rule->pcnt, rule->bcnt); + printf("%*qu %*qu ", rule->pcnt, rule->bcnt); if (do_time) { char timestr[30]; @@ -1212,7 +1212,7 @@ return; } - printf("%05d %10qu %10qu (%ds)", + printf("%05d %*qu %*qu (%ds)", d->rulenum, d->pcnt, d->bcnt, d->expire); switch (d->dyn_type) { case O_LIMIT_PARENT: %%% > ----- forwarded message ----- > > Date: Tue, 21 Jan 2003 03:33:55 +0200 > From: Giorgos Keramidas > Subject: bin/47196: ipfw won't format correctly output from 'ipfw show' command > To: ipfw@freebsd.org > > The attached patch changes ipfw2 to print packet and byte counts with > a wider format, that fixes the problem described in PR bin/47196. Do > you think it's ok to commit this to CURRENT? > > --- patch start --- > Index: ipfw2.c > =================================================================== > RCS file: /home/ncvs/src/sbin/ipfw/ipfw2.c,v > retrieving revision 1.21 > diff -u -r1.21 ipfw2.c > --- ipfw2.c 12 Jan 2003 03:31:10 -0000 1.21 > +++ ipfw2.c 21 Jan 2003 01:30:03 -0000 > @@ -823,7 +823,7 @@ > printf("%05u ", rule->rulenum); > > if (do_acct) > - printf("%10qu %10qu ", rule->pcnt, rule->bcnt); > + printf("%20qu %20qu ", rule->pcnt, rule->bcnt); > > if (do_time) { > char timestr[30]; > @@ -1212,7 +1212,7 @@ > return; > } > > - printf("%05d %10qu %10qu (%ds)", > + printf("%05d %20qu %20qu (%ds)", > d->rulenum, d->pcnt, d->bcnt, d->expire); > switch (d->dyn_type) { > case O_LIMIT_PARENT: > --- patch end --- > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-audit" in the body of the message > -- Maxim Konovalov, maxim@macomnet.ru, maxim@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message