From candy@kgc.co.jp  Fri Mar 31 08:11:20 2006
Return-Path: <candy@kgc.co.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6522D16A429
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Mar 2006 08:11:20 +0000 (UTC)
	(envelope-from candy@kgc.co.jp)
Received: from nsx.kgc.co.jp (nsx.kgc.co.jp [210.163.35.34])
	by mx1.FreeBSD.org (Postfix) with SMTP id B236843D46
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Mar 2006 08:11:19 +0000 (GMT)
	(envelope-from candy@kgc.co.jp)
Received: (qmail 78132 invoked from network); 31 Mar 2006 17:11:17 +0900
Received: from ssm.kgc.co.jp (210.163.35.37)
  by nsx.kgc.co.jp with SMTP; 31 Mar 2006 17:11:17 +0900
Received: (qmail 57334 invoked from network); 31 Mar 2006 17:11:17 +0900
Received: from unknown (HELO xxx.kgc.co.jp) (172.30.2.3)
  by mail.kgc.co.jp with SMTP; 31 Mar 2006 17:11:17 +0900
Received: (qmail 93188 invoked by uid 10100); 31 Mar 2006 08:11:17 -0000
Message-Id: <20060331081116.93187.qmail@xxx.kgc.co.jp>
Date: 31 Mar 2006 08:11:16 -0000
From: <candy-sendpr@kgc.co.jp>
Reply-To: <candy-sendpr@kgc.co.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ipfw][patch]ipfw -p option handler is bogus
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         95146
>Category:       bin
>Synopsis:       [ipfw][patch]ipfw -p option handler is bogus
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ipfw
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 31 08:20:14 GMT 2006
>Closed-Date:    Sat Oct 21 16:03:54 GMT 2006
>Last-Modified:  Sat Oct 21 16:03:54 GMT 2006
>Originator:     
>Release:        FreeBSD 6.0-RELEASE-p6 i386
>Organization:
-
>Environment:
	FreeBSD 5.4-R or FreeBSD 6.0-R
>Description:
	bogus things happen if you type
	`ipfw -p /usr/bin/m4'
	ipfw fopen(3)s /usr/bin/m4 then pass the FILE pointer to /usr/bin/m4.
>How-To-Repeat:
	# ipfw -p /usr/bin/m4
	command is (null)
	: TMPDIR=/tmp: No such file or directory
	: COLUMNS=80: No such file or directory
	: FTP_PASSIVE_MODE=YES: No such file or directory
	: BLOCKSIZE=K: No such file or directory
	(snip)
	ipfw: preprocessor exited with signal 11
	#

>Fix:

--- ipfw2.c.orig	Fri Mar 31 16:45:23 2006
+++ ipfw2.c	Fri Mar 31 17:05:15 2006
@@ -5099,8 +5099,11 @@
 			 */
 			av += optind - 1;
 			ac -= optind - 1;
+			if (ac == 1) {
+				errx(EX_USAGE, "no filename arguments");
+			}
 			av[ac-1] = NULL;
-			fprintf(stderr, "command is %s\n", av[0]);
+			/*fprintf(stderr, "command is %s\n", av[0]);*/
 			break;
 
 		case 'q':
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-ipfw 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Mar 31 08:30:45 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95146 
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Fri Sep 29 08:01:06 UTC 2006 
State-Changed-Why:  
A slightly modified patch was committed to HEAD.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95146 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/95146: commit references a PR
Date: Fri, 29 Sep 2006 08:00:55 +0000 (UTC)

 maxim       2006-09-29 08:00:40 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/ipfw            ipfw2.c 
   Log:
   o Check for a required "pathname" argument presence.
   
   PR:             bin/95146
   Submitted by:   candy-sendpr@kgc.co.jp
   MFC after:      3 weeks
   
   Revision  Changes    Path
   1.99      +2 -0      src/sbin/ipfw/ipfw2.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Sat Oct 21 16:03:37 UTC 2006 
State-Changed-Why:  
Merged to RELENG_6. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95146 
>Unformatted:
