From 63dcc52d80c4f46012e93cd46995147eb2d2f404 Mon Sep 17 00:00:00 2001 From: Nik Lutz Date: Fri, 22 Mar 2019 14:15:00 +0100 Subject: Unmount bind mounts in reverse order to allow nested bind mounts. Signed-off-by: Nik Lutz Signed-off-by: Daniel Baumann --- share/scripts/debconf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/scripts/debconf b/share/scripts/debconf index 0a05935..35b5969 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -1097,7 +1097,8 @@ fi # Unmounting ro bind mounts if [ -n "${BIND_RO}" ] then - BINDS_RO="$(echo ${BIND_RO} | sed -e 's|;| |g')" + # unmount in reverse order to allow nested bind mounts + BINDS_RO="$(echo ${BIND_RO} | sed -e 's|;| |g' | awk '{ for (i=NF; i>=1; i--) printf "%s ", $i; print ""}')" for ENTRY in ${BINDS_RO} do @@ -1110,7 +1111,8 @@ fi # Unmounting rw bind mounts if [ -n "${BIND}" ] then - BINDS="$(echo ${BIND} | sed -e 's|;| |g')" + # unmount in reverse order to allow nested bind mounts + BINDS="$(echo ${BIND} | sed -e 's|;| |g' | awk '{ for (i=NF; i>=1; i--) printf "%s ", $i; print ""}')" for ENTRY in ${BINDS} do -- cgit v1.2.3