]> 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:22:13 +0000 (08:22 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 18 Jan 2022 15:31:01 +0000 (08:31 -0700)
commit80a0bd4b8873df38060309e775d609dcc219531f
tree7e2017ee3b199f1188cf2d3a0513cbd7d3db8aa4
parent3de40ae8b9a47c16d774f2c4dc729b6e6158139e
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
src/api.c