]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Make legacy lxc-ls more robust
authorDark Templar <dark_templar@hotbox.ru>
Mon, 27 Oct 2014 13:33:04 +0000 (08:33 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 27 Oct 2014 13:33:04 +0000 (08:33 -0500)
Behave well when /etc/lxc/${name} is a symlink to directory

Signed-off-by: Dark Templar <dark_templar@hotbox.ru>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/legacy/lxc-ls.in

index a7b3b19e0fecd2ca898a414f7b4846b33519299e..a823bd04c95035c56c581e88aac01fcc72f32668 100644 (file)
@@ -86,7 +86,7 @@ done
 containers=""
 if [ ! -z "$directory" ]; then
        if [ x"$parent_cgroup" = x ]; then
-               containers=$(find $directory -mindepth 2 -maxdepth 2 -name config -type f |awk -F "/" '{print $(NF-1)}')
+               containers=$(find -L $directory -mindepth 2 -maxdepth 2 -name config -type f |awk -F "/" '{print $(NF-1)}')
        else
                containers=$(find $directory -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:.*/::')
        fi