]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
killall: filter out bogus PIDs
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Sep 2018 17:04:44 +0000 (19:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 25 Sep 2018 10:50:35 +0000 (12:50 +0200)
we might as well filter these too since negative PIDs have special
semantics in kill(), and we should never trigger that...

src/core/killall.c

index 3dde3033fa3b97773cf9b1e40936f5d5547fdf7e..37c645538cbbb4c27630f3a73d5072d14ce09895 100644 (file)
@@ -29,7 +29,7 @@ static bool ignore_proc(pid_t pid, bool warn_rootfs) {
         int r;
 
         /* We are PID 1, let's not commit suicide */
-        if (pid == 1)
+        if (pid <= 1)
                 return true;
 
         /* Ignore kernel threads */