lscgroup tool in display_controller_data procedure trimmed relative path
name too strictly, thus if the path have no leading "/" sign then the first
character was trimmed too.
Example: 
$ lscgroup freezer:libvirt
freezer:/ibvirt/
freezer:/ibvirt/lxc
freezer:/ibvirt/qemu

this patch fixes the problem.

Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com>
---

 src/tools/lscgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/tools/lscgroup.c b/src/tools/lscgroup.c
index 6ab2103..1df2127 100644
--- a/src/tools/lscgroup.c
+++ b/src/tools/lscgroup.c
@@ -100,7 +100,7 @@ static int display_controller_data(char *input_path, char 
*controller, char *nam
        /* remove problematic  '/' characters from input path*/
        trim_filepath(input_dir_path);
 
-       len  = strlen(info.full_path) - strlen(input_dir_path);
+       len  = strlen(info.full_path) - strlen(input_dir_path) - 1;
        print_info(&info, name, len);
        while ((ret = cgroup_walk_tree_next(0, &handle, &info, lvl)) == 0)
                print_info(&info, name, len);


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to