From wbhacker@ccsf.homeunix.org  Sun Oct 26 05:48:02 2003
Return-Path: <wbhacker@ccsf.homeunix.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7CD0816A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Oct 2003 05:48:02 -0800 (PST)
Received: from ccsf.homeunix.org (ccsf.as.wakwak.ne.jp [61.205.237.177])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2957443F75
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Oct 2003 05:48:01 -0800 (PST)
	(envelope-from wbhacker@ccsf.homeunix.org)
Received: from ccsf.homeunix.org (localhost [127.0.0.1])
	by ccsf.homeunix.org (8.12.9p2/8.12.9) with ESMTP id h9QDlr9Z006302;
	Sun, 26 Oct 2003 22:47:53 +0900 (JST)
	(envelope-from wbhacker@Sakura.CardCaptors)
Received: (from wbhacker@localhost)
	by ccsf.homeunix.org (8.12.9p2/8.12.9/Submit) id h9QDlrL9006301;
	Sun, 26 Oct 2003 22:47:53 +0900 (JST)
	(envelope-from wbhacker)
Message-Id: <200310261347.h9QDlrL9006301@ccsf.homeunix.org>
Date: Sun, 26 Oct 2003 22:47:53 +0900 (JST)
From: OOTOMO Hiroyuki <ootomo@za.wakwak.zom>
Reply-To: OOTOMO Hiroyuki <ootomo@za.wakwak.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ootomo@za.wakwak.com
Subject: [PATCH] benchmarks/rawio has a bug in commandline option parser
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58567
>Category:       ports
>Synopsis:       [PATCH] benchmarks/rawio has a bug in commandline option parser
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    grog
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 26 05:50:18 PST 2003
>Closed-Date:    Fri Jan 09 23:57:37 PST 2004
>Last-Modified:  Fri Jan 09 23:57:37 PST 2004
>Originator:     OOTOMO Hiroyuki
>Release:        FreeBSD 4.9-RC i386
>Organization:
>Environment:
System: FreeBSD ccsf.homeunix.org 4.9-RC FreeBSD 4.9-RC #0: Sun Oct 26 17:36:45 JST 2003 root@ccsf.homeunix.org:/usr/obj/usr/src/sys/Sakura i386
Target-file-id: $Id: rawio.c,v 1.7 1999/07/21 02:10:09 grog Exp grog $

>Description:
run rawio with -s option(size of raw disk device), as follows:
    % rawio -a -s 30029328k -v 1 /dev/ad4c
returned:
    Invalid length specification: -v

in source rawio.c, it skips parsing argument at one point.
>How-To-Repeat:
run with -s option.

>Fix:
--- rawio.c.diff begins here ---
--- rawio.c.orig	Sun Oct 26 22:12:39 2003
+++ rawio.c	Sun Oct 26 22:22:29 2003
@@ -423,7 +423,7 @@
 	  printf ("No arg to n flag\n");
 	  break;
 	  }
-	filesize = sizespec (argv [++i]);
+	filesize = sizespec (arg);
 	break;
 
       case 'S':
--- rawio.c.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->grog 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Oct 26 14:45:18 PST 2003 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58567 
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Fri Jan 9 23:56:59 PST 2004 
State-Changed-Why:  
Commited, thanks. 
Please if you are able, can you give this feedback to the author? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58567 
>Unformatted:
 >>> lines: 416-427 <<<
       case 's':
         if (argv [i] [2] != '\0')
           arg = &argv [i] [2];
         else if (++i < argc)
           arg = argv [i];
         else
           {
           printf ("No arg to n flag\n");
           break;
           }
         filesize = sizespec (argv [++i]);
         break;
 
 
