]> granicus.if.org Git - procps-ng/commit
ps: Match on truncated 16 char for -C
authorCraig Small <csmall@dropbear.xyz>
Thu, 24 Sep 2020 12:01:22 +0000 (22:01 +1000)
committerCraig Small <csmall@dropbear.xyz>
Thu, 24 Sep 2020 12:01:22 +0000 (22:01 +1000)
commit3e1c00d051ae4a8319df7714d0545b4b7aa81557
tree1e61f84347c84ce080d7b9696513a547f723844a
parent6e1715d9ebcffd7a673cbacbca4416c42d103c7b
ps: Match on truncated 16 char for -C

The referenced commit the comm length was increased from 16 to 64
characters to handle the larger command names for things like kernel
threads.

However most user processes are limited to 15 characters which means
if you try something like ps -C myprogramisbiggerthansixteen this would
fail to match because /proc/<PID>/comm would only be myprogramisbigg

ps now checks the comm length and if it is 15 and if the given match
is 15 or more, it will only match the first 15 characters.

This is also how killall has worked for about a year.

Thanks to Jean Delvare <jdelvare@suse.de> for the note.

References:
 commit 14005a371e5c14289e96a4927ffd1a827d3c9d85
 commit psmisc/psmisc@1188315cd037d73bf946a0003b70c6423cc330d2

Signed-off-by: Craig Small <csmall@dropbear.xyz>
NEWS
ps/select.c