From a1d5ddea5b7db00548173cee8236aaad61cf5961 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 18 May 2013 23:13:09 +0100 Subject: Resolve mount point symlinks relative to the target chroot before unmounting them (closes: #702861, #703037, #704744). --- debian/changelog | 2 ++ functions | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9400489..d478a60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ debootstrap (1.0.51) UNRELEASED; urgency=low [ Colin Watson ] * Clarify location of pkgdetails.c in error message (closes: #708771). + * Resolve mount point symlinks relative to the target chroot before + unmounting them (closes: #702861, #703037, #704744). -- Colin Watson Sat, 18 May 2013 22:35:11 +0100 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 } -- cgit v0.12