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

Re: Bourne shell assistance needed for Bug #422909



On Wednesday 09 May 2007 23:48, Roger Leigh wrote:
> {
>     "$LIBEXEC_DIR/schroot-listmounts" -m "$1" |
>     while read mountloc; do
> 	if [ "$AUTH_VERBOSITY" = "verbose" ]; then
> 	    echo "Unmounting $mountloc"
> 	fi
> 	umount "$mountloc" || exit 1
>     done || exit 1
> }
>
> The problem here is that if schroot-listmounts segfaults (the trigger
> in this case) or returns an error, the script continues without any
> indication of the fact, despite "set -e" being in effect.  In this bug
> this results in a failure to umount a set of mounted filesystems, and
> then an "rm -rf" taking out all the data further down the line.

Which means you need to get rid of the pipe.
Maybe:
	mounts="$("$LIBEXEC_DIR/schroot-listmounts" -m "$1")"
	echo "$mounts" | while read mountloc; do
	...

Attachment: pgpL45tMG07L7.pgp
Description: PGP signature


Reply to: