Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 1999 20:21:16 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        John-Mark Gurney <gurney_j@efn.org>, Julian Elischer <julian@whistle.com>, Brian Beattie <beattie@aracnet.com>, "Matthew N. Dodd" <winter@jurai.net>, Chuck Robey <chuckr@mat.net>, Wayne Cuddy <wayne@crb-web.com>, FreeBSD Hackers List <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: what is devfs? 
Message-ID:  <19990921122116.D696B1CA7@overcee.netplex.com.au>
In-Reply-To: Your message of "Mon, 20 Sep 1999 23:25:32 MST." <199909210625.XAA01972@apollo.backplane.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




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