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

Bug#640789: Crash on folder name with spaces



Hi Cyril,

Thanks for your attention. I think that was my patch. (Chris Tillman). 

The only line the patch is affecting is the one with find $dir, adding the quotes to make it find "$dir". 

The rest of it certainly does look strange, but anyway it works if you just add the quotes. Maybe another time to refactor it, because we have been waiting years for this patch already.

I verified today it is still present in the current testing installer.

Chris

On Mon, 7 Jul 2014 03:56:21 +0200 Cyril Brulebois <kibi@debian.org> wrote:
> 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.
>
> >   TOPLEVEL_DIRS_COUNT=$(($TOPLEVEL_DIRS_COUNT + 1))
> >  
> >   for iso in $isolist; do
>
> but then that means we're possibly going to fail here. Example:
>
> kibi@wodi:~/isos$ ls */
> baz/:
> baz.iso
>
> foo bar/:
> foobar.iso
> 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.)
>
> Mraw,
> KiBi.

Reply to: