From mi@aldan.ziplink.net  Wed Jan 28 21:37:56 1998
Received: from aldan.ziplink.net (mi@kot.ne.mediaone.net [24.128.29.55])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA00519
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Jan 1998 21:37:53 -0800 (PST)
          (envelope-from mi@aldan.ziplink.net)
Received: (from mi@localhost)
	by aldan.ziplink.net (8.8.8/8.8.7) id FAA11960;
	Thu, 29 Jan 1998 05:37:47 GMT
	(envelope-from mi)
Message-Id: <199801290537.FAA11960@aldan.ziplink.net>
Date: Thu, 29 Jan 1998 05:37:47 GMT
From: Mikhail Teterin <mi@aldan.algebra.com>
Reply-To: mi@aldan.algebra.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: killall's bogus diagnostics
X-Send-Pr-Version: 3.2

>Number:         5596
>Category:       bin
>Synopsis:       killall's diagnostics bogus
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    wosch
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 28 21:40:01 PST 1998
>Closed-Date:    Sun Aug 30 09:55:08 PDT 1998
>Last-Modified:  Sun Aug 30 09:55:44 PDT 1998
>Originator:     Mikhail Teterin
>Release:        FreeBSD 2.2.5-RELEASE i386
>Organization:
Virtual Estates, Inc.
>Environment:

>Description:

	If a process exists, but can not be killed (belongs to
	another user, for example), killall(1) will still report
	"No matching processes"

>How-To-Repeat:

	As a regular user do
		killall inetd

>Fix:
	Sorry, I'm no perl programmer...
>Release-Note:
>Audit-Trail:

From: Wolfram Schneider <wosch@cs.tu-berlin.de>
To: mi@aldan.algebra.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/5596: killall's bogus diagnostics
Date: 31 Jan 1998 15:13:33 +0100

 Mikhail Teterin <mi@aldan.algebra.com> writes:
 > >Description:
 > 
 > 	If a process exists, but can not be killed (belongs to
 > 	another user, for example), killall(1) will still report
 > 	"No matching processes"
 
 This is intentionally and not a bug. killall(1) try to kill only
 processes which can be killed. If I call `killall ftp', killall should
 only kill my ftp clients and not complains about the not killable ftp
 processes which belongs to other users.
 
 -- 
 Wolfram Schneider   <wosch@freebsd.org>   http://www.freebsd.org/~wosch/

From: Bill Fenner <fenner@parc.xerox.com>
To: Wolfram Schneider <wosch@cs.tu-berlin.de>
Cc: freebsd-gnats-submit@hub.freebsd.org, mi@aldan.algebra.com
Subject: Re: bin/5596: killall's bogus diagnostics 
Date: Sun, 1 Feb 1998 15:48:21 PST

 Ah, but it might be nice to change the diagnostic if there were no
 matching processes owned by you; something like this patch?
 
   Bill
 
 
 --- killall.pl.orig	Sun Feb  1 15:42:15 1998
 +++ killall.pl	Sun Feb  1 15:45:08 1998
 @@ -85,16 +85,22 @@
  	    $proc[$PROC_RUID], $proc[$PROC_NAME] if $debug > 1;
  
  	    if ( # match program name
 -	        ($proc[$PROC_NAME] eq $program ||
 -	         ($match && $proc[$PROC_NAME] =~ /$programMatch/oi)
 -	         ) &&
 -	        # id test
 -	        ($proc[$PROC_EUID] eq $id || # effective uid
 -	         $proc[$PROC_RUID] eq $id || # real uid
 -	         !$id))			 # root
 +	        $proc[$PROC_NAME] eq $program ||
 +	        ($match && $proc[$PROC_NAME] =~ /$programMatch/oi)
 +	         )
  	    {
 -	        push(@kill, $pid);
 -	        $thiskill++;
 +	        if ( # id test
 +			$proc[$PROC_EUID] eq $id || # effective uid
 +			$proc[$PROC_RUID] eq $id || # real uid
 +			!$id)			 # root
 +		{
 +		    push(@kill, $pid);
 +		    $thiskill++;
 +		}
 +		else
 +		{
 +		    $noperm++;
 +		}
  	    }
          }
          close STATUS;
 @@ -102,7 +108,13 @@
      closedir PROCFS;
  
      # nothing found
 -    warn "No matching processes ``$program''\n" unless $thiskill;
 +    if (!$thiskill) {
 +	if ($noperm) {
 +	    warn "No matching processes ``$program'' belonging to you\n";
 +	} else {
 +	    warn "No matching processes ``$program''\n";
 +	}
 +    }
  }
  
  # nothing found
Responsible-Changed-From-To: freebsd-bugs->wosch 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Aug 12 01:29:52 PDT 1998 
Responsible-Changed-Why:  
I'm the author fo killall 
State-Changed-From-To: open->closed 
State-Changed-By: wosch 
State-Changed-When: Sun Aug 30 09:55:08 PDT 1998 
State-Changed-Why:  
Fixed in rev 1.10 src/usr.bin/killall/killall.pl 
>Unformatted:
