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

Bug in lh_mount_devpts



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?
> 
> yes.
> 
> the check assumes, that if there is something in /dev/pts/*, then it
has
> to be unmounted. but there is always something in /dev/pts/*,
regardless
> if it is mounted, udev is running, or plain devices are used.
therefore,
> 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
    then

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? ;-)




Reply to: