Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Feb 1995 18:11:30 -0800
From:      Paul Traina <pst@shockwave.com>
To:        ugen@FreeBSD.org
Cc:        current@FreeBSD.org
Subject:   snp(4)/watch(8) code review comments
Message-ID:  <199502230211.SAA15059@precipice.Shockwave.COM>

next in thread | raw e-mail | index | archive | help
I did a preliminary run through the snp device code that you added and had 
some comments to make.  No insult intended, but I see room for improvement
here:

(a) we should document that this device is a BIG security hole and people
    should only compile it into their kernels if they're willing to
    take that risk

(b) It seems to me that having to specify the type of tty that you're
    looking at is brain-dead.  I see that you've got knowledge of the
    tty structures for the ptys, sios, and vtys.  All of this information
    is already in the cdevsw table and you should be accessing it via
    those vectors, not through your own back-door interface.

    The information passed down to the snp device should simply be the major
    and minor number of the tty you wish to attach to,  at which point you
    can just look up the point to the structure and verify that it's a tty
    class device and you're off and running.
    The current scheme seems rather i386 dependant (vty/pty/sio).  If you
    change it to major/minors, you get new devices for free without having
    to update the snoop code,  and you can do a major clean-up on watch(8)
    because you don't do name to device class conversion (which is a really
    icky thing, since it's perfectly reasonable for someone to name ptys as
    /dev/ttyvXX).

Would you consider making these changes before 2.1 ships?  If not, would
you mind if I changed the interface and watch and fixed it?

Paul



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502230211.SAA15059>