]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroup.c: redefine the valid cgroup name
authorQiang Huang <h.huangqiang@huawei.com>
Wed, 15 Jan 2014 04:09:26 +0000 (12:09 +0800)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 15 Jan 2014 15:39:21 +0000 (10:39 -0500)
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgroup.c

index 6d837f97ebc75db458b0ede8416daa25717c23e5..69910cc65c8fec1100760e658d752784bf0fc77d 100644 (file)
@@ -1669,7 +1669,11 @@ bool is_valid_cgroup(const char *name)
 {
        const char *p;
        for (p = name; *p; p++) {
-               if (*p < 32 || *p == 127 || *p == '/')
+               /* Use the ASCII printable characters range(32 - 127)
+                * is reasonable, we kick out 32(SPACE) because it'll
+                * break legacy lxc-ls
+                */
+               if (*p <= 32 || *p >= 127 || *p == '/')
                        return false;
        }
        return strcmp(name, ".") != 0 && strcmp(name, "..") != 0;