summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2013-05-18 22:13:09 (GMT)
committerColin Watson <cjwatson@debian.org>2013-05-18 22:13:41 (GMT)
commita1d5ddea5b7db00548173cee8236aaad61cf5961 (patch)
treea51a1ef193c9f339c70482f6befcc4562a062e77 /functions
parent092c6440851f9bbd6fdad6c53244f92a976e0928 (diff)
downloaddebootstrap-a1d5ddea5b7db00548173cee8236aaad61cf5961.zip
debootstrap-a1d5ddea5b7db00548173cee8236aaad61cf5961.tar.gz
debootstrap-a1d5ddea5b7db00548173cee8236aaad61cf5961.tar.bz2
Resolve mount point symlinks relative to the target chroot before unmounting them (closes: #702861, #703037, #704744).
Diffstat (limited to 'functions')
-rw-r--r--functions5
1 files changed, 4 insertions, 1 deletions
diff --git a/functions b/functions
index e5e16a3..a2e1431 100644
--- a/functions
+++ b/functions
@@ -955,8 +955,11 @@ setup_etc () {
UMOUNT_DIRS=
umount_exit_function () {
+ local realdir
for dir in $UMOUNT_DIRS; do
- ( cd / ; umount "$TARGET/${dir#/}" ) || true
+ realdir="$(in_target_nofail readlink -f "$dir")"
+ [ "$realdir" ] || continue
+ ( cd / ; umount "$TARGET/${realdir#/}" ) || true
done
}