[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#704744: pbuilder: umounts /{dev,run}/shm of the *host* system



tags 704744 + patch
thanks

Le 08/04/2013 01:32, Thorsten Glaser a écrit :
> My idea to fix this is:
> 
> Move the “umount_on_exit /dev/shm” line away from
> /usr/share/debootstrap/functions and into the files under
> /usr/share/debootstrap/scripts/ and then change it to use
> /run/shm from wheezy onwards (this also involves breaking
> up the symlink from etch, etch-m68k, lenny, oldstable,
> squeeze and stable to sid, and then, for the wheezy release,
> reintroducing the symlink from stable to sid).
> 
> Unless you’ve got a better one, that is.

Why not just do nothing if /dev/shm is a symlink?

Are there cases where umount_on_exit is called on a symlink that should
be followed? If not, I would just kill the problem directly there, as in
the attached patch (untested).


Cheers,

-- 
Stéphane

diff -Nru debootstrap-1.0.48/debian/changelog debootstrap-1.0.48+nmu1/debian/changelog
--- debootstrap-1.0.48/debian/changelog	2013-04-04 16:18:04.000000000 +0200
+++ debootstrap-1.0.48+nmu1/debian/changelog	2013-04-08 10:27:16.000000000 +0200
@@ -1,3 +1,11 @@
+debootstrap (1.0.48+nmu1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Do not follow symbolic links when unmounting filesystems in target
+    (Closes: #704744)
+
+ -- Stéphane Glondu <glondu@debian.org>  Mon, 08 Apr 2013 10:26:29 +0200
+
 debootstrap (1.0.48) unstable; urgency=low
 
   * Team upload
diff -Nru debootstrap-1.0.48/functions debootstrap-1.0.48+nmu1/functions
--- debootstrap-1.0.48/functions	2013-03-25 16:25:14.000000000 +0100
+++ debootstrap-1.0.48+nmu1/functions	2013-04-08 10:26:24.000000000 +0200
@@ -954,7 +954,7 @@
 
 umount_exit_function () {
 	for dir in $UMOUNT_DIRS; do
-		( cd / ; umount "$TARGET/${dir#/}" ) || true
+		( cd / ; test -l "$TARGET/${dir#/}" || umount "$TARGET/${dir#/}" ) || true
 	done
 }
 

Reply to: