NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/52626: unexpected behaavior from pkill(1)



>Number:         52626
>Category:       bin
>Synopsis:       pkill ignores "-g pgid" option if pattern is specified
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 09:35:00 +0000 2017
>Originator:     Paul Goyette
>Release:        NetBSD 8.99.3
>Organization:
+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+
>Environment:
	
	
System: NetBSD speedy.whooppee.com 8.99.3 NetBSD 8.99.3 (SPEEDY 2017-10-02 09:48:54 UTC) #0: Mon Oct 2 14:15:08 UTC 2017 paul%speedy.whooppee.com@localhost:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
	Based on the description in the man page, the pkill command
	should send the designated signal to "all processes that match
	the criteria given."  One would expect criteria to match the
	pattern as well as the other selection criteria such as -g

	However, the command "pkill -g 123 mail" ends up trying to
	kill all processes whose command name does not include the
	pattern "mail".  If run as root, it kills everything, including
	init (process 1).

	Not good.
	
>How-To-Repeat:
	Execute the following command as root and watch your system
	die:

		pkill -g 123 mail


	
>Fix:
Yes, please do.
	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index