A cgrulesengd daemon did not check whether a stickied process or when
setuid(2)/setgid(2) happens, and the daemon moved the process based on
/etc/cgrules.conf.
So --sticky option was not effective when setuid(2)/setgid(2).
This patch makes --sticky effective when setuid(2) and setgid(2) also.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
switch (type) {
case PROC_EVENT_UID:
case PROC_EVENT_GID:
+ /*
+ * If the unchanged process, the daemon should not change the
+ * cgroup of the process.
+ */
+ if (cgre_is_unchanged_process(ev->event_data.id.process_pid))
+ return 0;
pid = ev->event_data.id.process_pid;
break;
case PROC_EVENT_FORK: