From owner-freebsd-current Wed Feb 22 18:12:49 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id SAA14439 for current-outgoing; Wed, 22 Feb 1995 18:12:49 -0800 Received: from precipice.Shockwave.COM (precipice.shockwave.com [171.69.108.33]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id SAA14432; Wed, 22 Feb 1995 18:12:43 -0800 Received: from localhost (localhost [127.0.0.1]) by precipice.Shockwave.COM (8.6.9/8.6.9) with SMTP id SAA15059; Wed, 22 Feb 1995 18:11:36 -0800 Message-Id: <199502230211.SAA15059@precipice.Shockwave.COM> To: ugen@FreeBSD.org cc: current@FreeBSD.org Subject: snp(4)/watch(8) code review comments Date: Wed, 22 Feb 1995 18:11:30 -0800 From: Paul Traina Sender: current-owner@FreeBSD.org Precedence: bulk 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