New upstream version 2.5 upstream/2.5
authorgregor herrmann <gregoa@debian.org>
Fri, 23 Jun 2017 15:08:10 +0000 (17:08 +0200)
committergregor herrmann <gregoa@debian.org>
Fri, 23 Jun 2017 15:08:10 +0000 (17:08 +0200)
CHANGELOG
Makefile
cpulimit.c

index 1553264..1168d18 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+========== Changes in 2.5 =================
+
+* Added some protection against causing a fork bomb
+  when the throttled process is a parent to LimitCPU.
+  Patch provided by Johann Felix.
+
 ========== Changes in 2.4 =================
 
 * Introduced ability to watch children of the target
index 64f34f3..dd46fc3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION?=2.4
+VERSION?=2.5
 PREFIX?=/usr
 CFLAGS?=-Wall -O2 -DVERSION=$(VERSION)
 CC?=gcc
index 573c35c..145aef4 100644 (file)
@@ -685,7 +685,7 @@ CHILD *Find_Child_PIDs(CHILD *all_children, pid_t parent_pid)
              if (! strncmp(line, "PPid:", 5) )
              {
                  sscanf(&(line[6]), "%d", &new_ppid);
-                 if (new_ppid == parent_pid)
+                 if (new_ppid == parent_pid && current_pid != getpid() )
                  {
                      sscanf(proc_entry->d_name, "%d", &current_pid);
                      if (! Find_Child(all_children, current_pid) )