]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: avoid ambiguous controller name matches
authorliupan <490021209@qq.com>
Wed, 6 Jul 2022 19:53:35 +0000 (13:53 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 6 Jul 2022 19:55:03 +0000 (13:55 -0600)
commita18ae861e77f106517df203e30a810ba59b082d9
treed721f6844ad9df2e47adb00f0d5e48a9d9135706
parentec9f313301c0be6318593ec06d6abb33b753cfbb
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>
src/api.c