From takamune@mariners.mei.co.jp  Mon Dec 13 02:03:22 1999
Return-Path: <takamune@mariners.mei.co.jp>
Received: from bulls.mei.co.jp (bulls.mei.co.jp [202.224.189.102])
	by hub.freebsd.org (Postfix) with ESMTP id 848BB14FF7
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Dec 1999 02:03:20 -0800 (PST)
	(envelope-from takamune@mariners.mei.co.jp)
Received: by bulls.mei.co.jp (8.9.3/3.7W) with ESMTP id TAA23752
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Dec 1999 19:03:14 +0900 (JST)
Received: by mariners.mei.co.jp (8.9.1/3.7W) with ESMTP id TAA14040
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Dec 1999 19:03:09 +0900 (JST)
Received: by dream.vrl.mei.co.jp (8.9.3/3.7W-11/29/99)
	id TAA01365; Mon, 13 Dec 1999 19:03:27 +0900 (JST)
Message-Id: <199912131003.TAA01365@dream.vrl.mei.co.jp>
Date: Mon, 13 Dec 1999 19:03:27 +0900 (JST)
From: takamune@avrl.mei.co.jp
Sender: takamune@mariners.mei.co.jp
Reply-To: takamune@avrl.mei.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: Usage of ktrace(1) is invalid
X-Send-Pr-Version: 3.2

>Number:         15456
>Category:       bin
>Synopsis:       Usage of ktrace(1) is invalid
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mikeh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 13 02:10:01 PST 1999
>Closed-Date:    Tue Jul 10 19:55:16 PDT 2001
>Last-Modified:  Tue Jul 10 19:55:36 PDT 2001
>Originator:     Kazu TAKAMUNE
>Release:        FreeBSD 3.4-RC i386
>Organization:
Matsushita Electric Industrial Co., Ltd.
>Environment:

FreeBSD 3.4-RC(Mon Dec 13 13:26:38 JST 1999)
(4.0-CURRENT has the same problem)

>Description:

Usage of ktrace(1) is not equivalent to its manual page.

>How-To-Repeat:

% ktrace
usage: ktrace [-aCcid] [-f trfile] [-g pgid] [-p pid] [-t [cnisuv]
       ktrace [-aCcid] [-f trfile] [-t [cnisuw] command

% man 1 ktrace
SYNOPSIS
     ktrace [-aCcdi] [-f trfile] [-g pgrp] [-p pid] [-t trstr]
     ktrace [-adi] [-f trfile] [-t trstr] command

>Fix:
--- src/usr.bin/ktrace/ktrace.c.orig	Mon Aug 30 00:29:12 1999
+++ src/usr.bin/ktrace/ktrace.c	Mon Dec 13 19:00:00 1999
@@ -188,8 +188,8 @@
 usage()
 {
 	(void)fprintf(stderr, "%s\n%s\n",
-"usage: ktrace [-aCcid] [-f trfile] [-g pgid] [-p pid] [-t [cnisuv]",
-"       ktrace [-aCcid] [-f trfile] [-t [cnisuw] command");
+"usage: ktrace [-aCcid] [-f trfile] [-g pgid] [-p pid] [-t trstr]",
+"       ktrace [-adi] [-f trfile] [-t trstr] command");
 	exit(1);
 }
 

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Fri Jun 15 23:13:57 PDT 2001 
State-Changed-Why:  


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15456 
State-Changed-From-To: closed->open 
State-Changed-By: mikeh 
State-Changed-When: Fri Jun 15 23:14:50 PDT 2001 
State-Changed-Why:  
Doh! Meant to take ownership, not close it. What's the correct way to 
abort a PR change? 


Responsible-Changed-From-To: freebsd-bugs->	 mikeh 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Fri Jun 15 23:14:50 PDT 2001 
Responsible-Changed-Why:  
I have a patch for this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15456 

From: Mike Heffner <mheffner@novacoxmail.com>
To: FreeBSD-audit <FreeBSD-audit@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/15456 usage fix and bug fix
Date: Sat, 16 Jun 2001 02:24:49 -0400 (EDT)

 This message is in MIME format
 --_=XFMail.1.4.7.FreeBSD:20010616022449:63573=_
 Content-Type: text/plain; charset=us-ascii
 
 Could someone take a quick look at the patch attached. It's to close pr
 bin/15456, but is slightly different than the patch in the pr. The main
 difference is the change pid->pidset. It appears this is a bug, because pid can
 be unitialized and testing against it isn't right.
 
 Thanks,
 
 Mike
 
 -- 
   Mike Heffner               <mheffner@vt.edu>
   Fredericksburg, VA       <mikeh@FreeBSD.org>
       http://filebox.vt.edu/users/mheffner
 
 
 
 Index: ktrace.1
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/ktrace/ktrace.1,v
 retrieving revision 1.9
 diff -u -r1.9 ktrace.1
 --- ktrace.1    2000/11/20 19:20:51     1.9
 +++ ktrace.1    2001/06/16 06:16:50
 @@ -42,8 +42,7 @@
  .Nm
  .Op Fl aCcdi
  .Op Fl f Ar trfile
 -.Op Fl g Ar pgrp
 -.Op Fl p Ar pid
 +.Op Fl g Ar pgrp | Fl p Ar pid
  .Op Fl t Ar trstr
  .Nm
  .Op Fl adi
 Index: ktrace.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/ktrace/ktrace.c,v
 retrieving revision 1.14
 diff -u -r1.14 ktrace.c
 --- ktrace.c    2000/09/04 06:09:46     1.14
 +++ ktrace.c    2001/06/16 06:16:50
 @@ -131,7 +131,7 @@
                         trpoints = ALL_POINTS;
                         pid = 1;
                 } else
 -                       ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE;
 +                       ops |= pidset ? KTROP_CLEAR : KTROP_CLEARFILE;
  
                 if (ktrace(tracefile, ops, trpoints, pid) < 0)
                         err(1, "%s", tracefile);
 @@ -186,8 +186,8 @@
  usage()
  {
         (void)fprintf(stderr, "%s\n%s\n",
 -"usage: ktrace [-aCcid] [-f trfile] [-g pgid] [-p pid] [-t [cnisuv]",
 -"       ktrace [-aCcid] [-f trfile] [-t [cnisuw] command");
 +"usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t cnisuw]",
 +"       ktrace [-adi] [-f trfile] [-t cnisuw] command");
         exit(1);
  }
  
 
 
 --_=XFMail.1.4.7.FreeBSD:20010616022449:63573=_
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.0.4 (FreeBSD)
 Comment: For info see http://www.gnupg.org
 
 iD8DBQE7KvuxFokZQs3sv5kRAm5bAJ9Fwvrj9n+dkHBfv46zIdy27NG6EgCfaYsf
 b2v8B7QjZ5s/pWVECHonpME=
 =yHmY
 -----END PGP SIGNATURE-----
 
 --_=XFMail.1.4.7.FreeBSD:20010616022449:63573=_--
 End of MIME message
State-Changed-From-To: open->analyzed 
State-Changed-By: mikeh 
State-Changed-When: Tue Jun 26 20:01:22 PDT 2001 
State-Changed-Why:  
Fix has been committed to current. Will MFC in two weeks. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15456 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mikeh 
State-Changed-When: Tue Jul 10 19:55:16 PDT 2001 
State-Changed-Why:  
Fix MFC'd. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15456 
>Unformatted:
