]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: avoid ambiguous controller name matches
authorliupan <490021209@qq.com>
Wed, 6 Jul 2022 20:01:29 +0000 (14:01 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 6 Jul 2022 20:01:34 +0000 (14:01 -0600)
commit0f94ee345a5bb47882e2ec9ea04b3613219e5343
treedb588dcbbf31dc8bf64cbd8705254a6b3d0103ab
parent8688d1f42a6638723628a3acd2a49f9361144a0a
api.c: avoid ambiguous controller name matches

calling "hasmntopt" to determine if the controller name exists in
"mntopt", may cause errors because of "hasmntopt" only match substring.

cpu controller may incorrectly match to cpuset when cpuset mount info
appeared before cpu,cpuacct in "/proc/mounts", so we need to validate
the last character to make sure the controller name matches exactly.

Signed-off-by: liupan <490021209@qq.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit a18ae861e77f106517df203e30a810ba59b082d9)
src/api.c