Bug in lh_mount_devpts
- Subject: Bug in lh_mount_devpts
- From: ben at bncnetservice.nl (Ben Mesman (B&C Netservice))
- Date: Fri, 7 Dec 2007 13:45:09 +0100
- Message-id: <2AB5E2596900E845AFD025D0F814531D021CE0CB@bnc-exchange.bnc.local>
Daniel Baumann wrote:
> Justin Pryzby wrote:
> > On Sat, Dec 01, 2007 at 05:03:01PM +0100, Daniel Baumann wrote:
> >> Otavio Salvador wrote:
> >>>> - if [ -e chroot/dev/pts/0 ]
> >>>> + if ls /dev/pts/[0-9] > /dev/null 2>&1
> >>> chroot/dev/pts/* ?
> >> both checks are insufficient, as they are always true.
> > Really?
> the check assumes, that if there is something in /dev/pts/*, then it
> to be unmounted. but there is always something in /dev/pts/*,
> if it is mounted, udev is running, or plain devices are used.
> any check for existence of /dev/pts/* is insufficient.
> (probably, it is sufficient on etch, but it's not on sid.)
Ok, my hack was not well received, but I thought a check on
chroot/dev/pts/[0-9] would be better than the original, because
chroot/dev/pts/0 does not need to exist when devpts is mounted.
Could we do something like this:
if grep -q $(pwd)/chroot/dev/pts /proc/mounts
I am not sure if that is the correct path to check, but something like
this at least tries to verify if devpts is indeed mounted, regardless of
files in this directory.
(what files exist in /dev/pts in sid when devpts is not mounted, and why
is this not a bug? ;-)