]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api: Add extra debugging when matching rule to a group
authorAaron Tomlin <atomlin@atomlin.com>
Mon, 13 Jan 2025 18:18:05 +0000 (11:18 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 16 Jan 2025 16:55:35 +0000 (09:55 -0700)
commit9155a813ff1837ec5287ca7fb26706479dbb8390
treee2ba68b4117b7167f53bfd166c4cfb863bad419d
parentd0becd6c53781d4233a3f82b7b9faa8d5108a606
api: Add extra debugging when matching rule to a group

In the context of a group rule (i.e. indicated by '@' used to prefix the
actual group name), getgrnam(3) is used to provide a pointer to a group
file entry that may contain a NULL-terminated array of pointers to group
members. A user can belong to multiple groups. With this information, we
then check the username that corresponds to the specified UID against
each group member for a match. This patch makes it possible to see this
information if debug level logging is enabled.

Use the new cgroup_get_loglevel() API to optimize the rule loop to
minimize performance impacts.

Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/api.c