From: Daniel Hokka Zakrisson Date: Sat, 6 Oct 2007 17:23:59 +0000 (+0000) Subject: People love symlinks. X-Git-Tag: release-0.30.215~93 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffdf991caae52a320d02c8a211143c18568a9884;p=util-vserver.git People love symlinks. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2613 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- 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