File 0001-cgrulesengd-Do-not-ignore-changes-of-short-lived-pro.patch of Package libcgroup.11263

From 4cbedeae74ca5cfd1678ca8e8a29b5d65c3a87f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20Koutn=C3=BD?= <mkoutny@suse.com>
Date: Mon, 18 Mar 2019 18:07:24 +0100
Subject: [PATCH] cgrulesengd: Do not ignore changes of short-lived processes

When a double-forking daemon spawns the shortlived forking process and
we fail to classify it in time, we cannot assume the child inherits
cgroup membership.

Instead we apply the logic introduced in
    8953fc07c0498d1ddd9a04dc549ffb85862f4c5f
assuming the parent would have changed its cgroup membership by out
actions.
---
 src/daemon/cgrulesengd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c
index 0d288f3..f113b14 100644
--- a/src/daemon/cgrulesengd.c
+++ b/src/daemon/cgrulesengd.c
@@ -478,8 +478,9 @@ int cgre_process_event(const struct proc_event *ev, const int type)
 	ret = cgroup_change_cgroup_flags(euid, egid, procname, pid,
 						 CGFLAG_USECACHE);
 	if ((ret == ECGOTHER) && (errno == ESRCH)) {
-		/* A process finished already and that is not a problem. */
-		ret = 0;
+		/* A process finished already but we may have missed changing,
+		 * make sure to apply to forked children. */
+		ret = cgre_store_parent_info(pid);
 	} else if (ret) {
 		flog(LOG_WARNING,
 			"Cgroup change for PID: %d, UID: %d, GID: %d, PROCNAME: %s FAILED! (Error Code: %d)\n",
-- 
2.16.4

openSUSE Build Service is sponsored by