]> granicus.if.org Git - psmisc/commit
killall: use openat and pidfd_send_signal
authorCraig Small <csmall@dropbear.xyz>
Thu, 17 Mar 2022 06:52:35 +0000 (17:52 +1100)
committerCraig Small <csmall@dropbear.xyz>
Thu, 17 Mar 2022 06:52:35 +0000 (17:52 +1100)
commitb085f2f4ace1aa2f2897a53ea1935853d583dcef
tree2a2e700eba55927ee6b0ec8b59a449d08f1c0251
parent99d69e2baf7f832e1368ada25bfbb4e0f7adbc94
killall: use openat and pidfd_send_signal

Using openat and pidfd_send_signal by openig the pid directory
at the start means we cannot have the situation where the PID
has been reused and we filter/kill the wrong process.

In other words, is the open(/proc/1234) the same process as
kill(1234) ? Using pidfd we can be sure.

References:
 psmisc/psmisc#37
ChangeLog
src/killall.c