item_in_dir() shell function does not handle missing directory
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-
Found initrd image: /boot/initrd.
Found memtest86+ image: /boot/memtest86
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/
[ -d "$2" ] || return 1
...makes the problem go away.
Thanks; committed upstream.