]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: cache cgrules with CGFLAG_USECACHE flag
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 18 Jan 2022 15:35:04 +0000 (08:35 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 18 Jan 2022 15:35:13 +0000 (08:35 -0700)
commitb7275a0fcb85be77c4dfdc953f16adfcaa558723
tree33a0929707b645be0e13c2df521fd18f8aed611d
parent63e8ba8126c40acc6cd9f62980fc1c444ad7b1e7
api.c: cache cgrules with CGFLAG_USECACHE flag

pam_cgroup.so plugin uses /etc/cgrules.conf to assign processes
to the requested cgroup.  This works well with active
cgrulesengd but in the instances where cgrulesengd is disabled,
the rules are not read and cached by default. Fix this is by
reloading and caching the rules when called with CGFLAG_USECACHE
flag.

Fixes: https://github.com/libcgroup/libcgroup/issues/84
Reported-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Minor commit comment changes
(cherry picked from commit 80a0bd4b8873df38060309e775d609dcc219531f)
src/api.c