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

Bug#640789: Crash on folder name with spaces

Control: tag -1 -patch

Hi Modestas,

Modestas Vainius <modax@debian.org> (2013-12-29):
> Control: tags -1 patch

thanks for the patch but I'm not convinced, see below:

> --- a/debian/iso-scan.postinst
> +++ b/debian/iso-scan.postinst
> @@ -162,7 +162,7 @@ scan_device_for_isos() {
>  			elif [ "$look_subdirs" = 1 ]; then
>  				opt="-type f"
>  			fi
> -			isolist=$(find $dir $opt -name "*.iso" -o -name "*.ISO" 2>/dev/null)
> +			isolist=$(find "$dir" $opt -name "*.iso" -o -name "*.ISO" 2>/dev/null)

This part is certainly OK; at least I can't think of a reason why that
wouldn't be a good thing.

>  			for iso in $isolist; do

but then that means we're possibly going to fail here. Example:

kibi@wodi:~/isos$ ls */

foo bar/:
kibi@wodi:~/isos$ isolist=$(find "$dir" $opt -name "*.iso" -o -name
"*.ISO" 2>/dev/null)
kibi@wodi:~/isos$ for iso in $isolist; do echo "Found ISO $iso"; done
Found ISO ./foo
Found ISO bar/foobar.iso
Found ISO ./baz/baz.iso

I guess it would make sense to fix this for real instead of hiding it a
bit further. Unfortunately 4am isn't a great time to set up a reproducer
and to keep on hacking. :/

(Also, sorry for the lag.)


Attachment: signature.asc
Description: Digital signature

Reply to: