#520252 cowbuilder: removes build directory even if pbuilder failed to umount bind mounts

Package:
cowdancer
Source:
cowdancer
Description:
Copy-on-write directory tree utility
Submitter:
Stefan Fritsch
Date:
2015-11-03 08:48:09 UTC
Severity:
wishlist
#520252#5
Date:
2009-03-18 12:03:35 UTC
From:
To:
cowbuilder calls rm -rf on the build directory even if pbuilder did not
correctly umount bind mounted directories. This can cause serious data loss.
cowbuilder should rely on pbuilder to clean up the directory.

See #520251

#520252#10
Date:
2009-03-18 13:59:47 UTC
From:
To:
At Wed, 18 Mar 2009 13:03:35 +0100,
Stefan Fritsch wrote:

patch welcome.

#520252#15
Date:
2009-03-18 13:59:47 UTC
From:
To:
At Wed, 18 Mar 2009 13:03:35 +0100,
Stefan Fritsch wrote:

patch welcome.

#520252#20
Date:
2009-03-18 14:18:43 UTC
From:
To:
reassign 520252 pbuilder
severity 520252 important
tags 520252 pending
thanks


I'd like to fix this with pbuilder fix, and keep the rm -rf.  If you
know of any reliable way to check if a bind-mounted directory is still
mounted, I'd like to hear about it.


At Wed, 18 Mar 2009 13:03:35 +0100,
Stefan Fritsch wrote:

#520252#33
Date:
2009-03-23 16:19:45 UTC
From:
To:
cowbuilder needs to be fixed, too.

cut -d' ' -f 2 /proc/mounts|
grep "$(cd /var/cache/pbuilder/build/cow.12345 ; pwd -P)"

should do it, at least if the user hasn't done stupid things like
making this a symlink to a directory with a name containing spaces.

Note that

find /var/cache/pbuilder/build/cow.12345 -xdev -depth -delete

is also somewhat better than rm -rf, as it will protect bind mounts
that come from other file systems than the one
containing /var/cache/pbuilder/ . It doesn't help if the user has
only one big filesystem, though.

#520252#42
Date:
2009-03-23 22:56:45 UTC
From:
To:
At Mon, 23 Mar 2009 17:19:45 +0100,
Stefan Fritsch wrote:

Yeah, exactly.

So, just a gradual improvement.

If you feel strongly, you may want to submit a patch.

#520252#51
Date:
2009-03-24 22:32:20 UTC
From:
To:
The 'gradual improvement' would likely catch 99% of all cases.

I am lacking time ATM, but I may look into creating a patch in a few
weeks.