From: Dark Templar Date: Mon, 27 Oct 2014 13:33:04 +0000 (-0500) Subject: Make legacy lxc-ls more robust X-Git-Tag: lxc-1.1.0.alpha3~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf1e86368272a7c342ad1eea6d61ac3694e182bf;p=thirdparty%2Flxc.git Make legacy lxc-ls more robust Behave well when /etc/lxc/${name} is a symlink to directory Signed-off-by: Dark Templar Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/legacy/lxc-ls.in b/src/lxc/legacy/lxc-ls.in index a7b3b19e0..a823bd04c 100644 --- a/src/lxc/legacy/lxc-ls.in +++ b/src/lxc/legacy/lxc-ls.in @@ -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