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
At Wed, 18 Mar 2009 13:03:35 +0100, Stefan Fritsch wrote: patch welcome.
At Wed, 18 Mar 2009 13:03:35 +0100, Stefan Fritsch wrote: patch welcome.
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:
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.
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.
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.