bin/95146: [ipfw][patch]ipfw -p option handler is bogus

candy-sendpr at kgc.co.jp candy-sendpr at kgc.co.jp
Fri Mar 31 08:20:20 UTC 2006


>Number:         95146
>Category:       bin
>Synopsis:       [ipfw][patch]ipfw -p option handler is bogus
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 31 08:20:14 GMT 2006
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


More information about the freebsd-bugs mailing list