Date: Sun, 12 Jan 1997 12:06:32 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: davidn@unique.usn.blaze.net.au (David Nugent) Cc: bde@zeta.org.au, joerg_wunsch@uriah.heep.sax.de, hackers@FreeBSD.org Subject: Re: DEVFS permissions &c. Message-ID: <199701121906.MAA25927@phaeton.artisoft.com> In-Reply-To: <Mutt.19970112022600.davidn@labs.blaze.net.au> from "David Nugent" at Jan 12, 97 02:26:00 am
next in thread | previous in thread | raw e-mail | index | archive | help
> Bruce Evans writes: > > >> I've exchanged a couple of thoughts with Bruce about it. Maybe we > > >> could teach mtree(8) to help in this step. > > > > > >Yes, that would certainly be the way to do it. > > > > Not really. Things it doesn't do right include: > > - wildcards. The equivalent of `chmod 666 /dev/tty[pqrs][PQRS]*' is a > > huge list. > > This could be resolved. It will involve expanding mtree's syntax a > little (about which I admit to knowing next to nothing :-)), > but I believe the basic functionality should be part of mtree, or > if not mtree, then something along the same lines. Isn't this a non-starter? I mean, shouldn't pty's be handled by: int clonefd; int slavefd, masterfd; char ptypath[ MAXNAMLEN]; /* * Open clone device */ clonefd = open( "/dev/pty", O_RD); /* * Reserve cloned master/slave pair path */ ioctl( clonefd, PTYIOCALLOC, &ptypath); /* * Open reserved FS object (always 'master'). This will * hold the reference */ masterfd = open( ptypath, O_RDWR); /* * Now that rreference is held, clone device is not necessary */ close( clonefd); /* * Given an fd for the master, return an open fd on the slave; * it is not necessary for the slave to have an FS namespace * assignment (though it could, if it were needed for some * program for compatability. */ ioctl( masterfd, PTYIOCSLAVE, &slavefd); ... With 'ptypath' ending up containing something like "/dev/pty/000"... after all, there is no reason a "dir" can't be a device as well, since you can use VOP_READDIR() to iterate subdevices and VOP_READ() to operate on the device itself. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701121906.MAA25927>