From: Jan Safranek Date: Wed, 6 Apr 2011 06:36:58 +0000 (+0200) Subject: Fixed parsing of mount options X-Git-Tag: v0.38~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f66841f8a5f1ebe4360293783f97efd680ecb1f;p=thirdparty%2Flibcgroup.git Fixed parsing of mount options hasmntopt() returns start of the matching string, i.e. when looking for 'cpuacct' option it can return 'cpuacct,cpuset' if these two are mounted together. So, don't use result of this function, use internal table of controllers instead when checking for duplicates. Signed-off-by: Jan Safranek Acked-by: Ivana Hutarova Varekova --- diff --git a/src/api.c b/src/api.c index b76b7932..c3dba988 100644 --- a/src/api.c +++ b/src/api.c @@ -817,7 +817,8 @@ int cgroup_init(void) /* do not have duplicates in mount table */ duplicate = 0; for (j = 0; j < found_mnt; j++) { - if (strncmp(mntopt, cg_mount_table[j].name, + if (strncmp(controllers[i], + cg_mount_table[j].name, FILENAME_MAX) == 0) { duplicate = 1; break;