item_in_dir() shell function does not handle missing directory

Bug #798447 reported by Daniel Richard G.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-prober (Ubuntu)
Fix Released
Low
Colin Watson

Bug Description

Binary package hint: os-prober

This concerns os-prober 1.44ubuntu1 in Ubuntu Natty.

When I invoke update-grub(8) in a certain chroot'ed Ubuntu installation, I see this:

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.38-8-generic
Found initrd image: /boot/initrd.img-2.6.38-8-generic
Found memtest86+ image: /boot/memtest86+.bin
  No volume groups found
ls: cannot access /config: No such file or directory
ls: cannot access /config: No such file or directory
ls: cannot access /config: No such file or directory
ls: cannot access /config: No such file or directory
ls: cannot access /config: No such file or directory
ls: cannot access /config: No such file or directory
ls: cannot access /config: No such file or directory
done

I have a filesystem mounted on /config outside of the chroot. Because the system /proc directory is bind-mounted inside the chroot, /proc/mounts shows the /config mount, even though it is not accessible.

I traced the operation of update-grub(8) to see what was producing the ls(1) errors, leading me to to the item_in_dir() function in /usr/share/os-prober/common.sh. Adding the following line to it, in the appropriate place...

    [ -d "$2" ] || return 1

...makes the problem go away.

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks; committed upstream.

Changed in os-prober (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package os-prober - 1.48

---------------
os-prober (1.48) unstable; urgency=low

  [ Colin Watson ]
  * Depend on grub-mount-udeb (see changelog for 1.45).
  * item_in_dir: return 1 immediately if second argument is not a directory
    (thanks, Daniel Richard G.; LP: #798447).

  [ Otavio Salvador ]
  * add MeeGo detection support; thanks to Chengwei Yang
    <email address hidden> for the patch.
  * Fix Windows detection when there are more then one boot directories
    (e.g boot and Boot). Closes: #634649.
 -- Colin Watson <email address hidden> Sun, 24 Jul 2011 10:06:55 +0000

Changed in os-prober (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.