From owner-freebsd-hackers Tue Sep 21 5:21:23 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from overcee.netplex.com.au (overcee.netplex.com.au [202.12.86.7]) by hub.freebsd.org (Postfix) with ESMTP id C9E9115297 for ; Tue, 21 Sep 1999 05:21:18 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id D696B1CA7; Tue, 21 Sep 1999 20:21:16 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.0.2 2/24/98 To: Matthew Dillon Cc: John-Mark Gurney , Julian Elischer , Brian Beattie , "Matthew N. Dodd" , Chuck Robey , Wayne Cuddy , FreeBSD Hackers List Subject: Re: what is devfs? In-reply-to: Your message of "Mon, 20 Sep 1999 23:25:32 MST." <199909210625.XAA01972@apollo.backplane.com> Date: Tue, 21 Sep 1999 20:21:16 +0800 From: Peter Wemm Message-Id: <19990921122116.D696B1CA7@overcee.netplex.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon wrote: > I think devfs is really cool. I don't think it needs to have > fancy persistence in order to be useful. Likewise. I find myself never needing to change device permissions. I do wish however that there were some sort of "template" options for classes of names. The way I imagine it would work would be like this: By default, all devices start out as root:wheel, 0600. We can then change the default permissions by "class". For example, devices may be grouped something like this: disk, tape, tty, cua, pty, vty, etc. Then, we could change the default permissions by class, with something like this in a rc.* script: sysctl -w devfs.template.mode.cua=0660 sysctl -w devfs.template.owner.cua=`id -u uucp` sysctl -w devfs.template.group.cua=`id -g dialer` sysctl -w devfs.template.mode.disk=0620 sysctl -w devfs.template.group.disk=`id -g operator` sysctl -w devfs.template.mode.pty=0666 sysctl -w devfs.template.group.pty=`id -g tty` ... and so on. For this to work well, devices should track their "template" until they are explicitly given their own modes. For example, doing a chmod on /dev/rst0 will seperate it from the "tape" class. Until that point, it's modes change every time the template is changed. This allows us to boot with reasonable defaults and explicitly give permissions in bulk and still DTRT with devices appearing (eg: usb devices). An alternative to abusing sysctl might be to have some pseudo devices in (say) /dev/template/{pty,disk,tape,....} that can be directly tweaked with chmod/chown/etc.. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message