Re: [lxc-devel] [PATCH] cgroup.c: redefine the valid cgroup name

2014-01-15 Thread Stéphane Graber
On Wed, Jan 15, 2014 at 12:09:26PM +0800, Qiang Huang wrote:
> 
> Signed-off-by: Qiang Huang 

Acked-by: Stéphane Graber 

> ---
>  src/lxc/cgroup.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
> index 6d837f9..69910cc 100644
> --- a/src/lxc/cgroup.c
> +++ b/src/lxc/cgroup.c
> @@ -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;
> -- 
> 1.8.3
> 

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com


signature.asc
Description: Digital signature
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [PATCH] cgroup.c: redefine the valid cgroup name

2014-01-14 Thread Qiang Huang

Signed-off-by: Qiang Huang 
---
 src/lxc/cgroup.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index 6d837f9..69910cc 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -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;
-- 
1.8.3

___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel