From ffdf991caae52a320d02c8a211143c18568a9884 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sat, 6 Oct 2007 17:23:59 +0000 Subject: [PATCH] People love symlinks. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2613 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- scripts/vserver.functions | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/vserver.functions b/scripts/vserver.functions index 01e4c4a..e2372f7 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -1216,17 +1216,22 @@ function _namespaceCleanup local root=$($_VSERVER_INFO "$1" VDIR 1) local -a list local -a skip - local tmp + local i + local j getFileArray skip "$vdir"/namespace-cleanup-skip \ "$__CONFDIR"/.defaults/namespace-cleanup-skip || : # these are things that have to be accessible post-cleanup - for tmp in "$root" "$__SBINDIR" "$__PKGLIBDIR" "$vdir" \ + for i in "$root" "$__SBINDIR" "$__PKGLIBDIR" "$vdir" \ "$__PKGSTATEDIR" "$__LOCKDIR" /usr/local /tmp "${skip[@]}"; do - while test -n "$tmp"; do - list=( "${list[@]}" "$tmp" ) - tmp="${tmp%/*}" + local real=`readlink -f "$i"` + test "$i" != "$real" || real= + for j in "$i" "$real"; do + while test -n "$j"; do + list=( "${list[@]}" "$j" ) + j="${j%/*}" + done done done -- 1.8.1.5