Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 2001 16:25:06 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Warner Losh <imp@harmony.village.org>
Cc:        arch@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/ata ata-disk.c
Message-ID:  <XFMail.010131162506.jhb@FreeBSD.org>
In-Reply-To: <200102010008.f1108O926986@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 01-Feb-01 Warner Losh wrote:
> In message <XFMail.010131160300.jhb@osd.bsdi.com> John Baldwin writes:
>: during boot.  One thing that Mike Smith would like to do (or so he has
>: told me) is to have aa env top-level sysctl node that mapped any names
>: below it to equivalent kernel environment variables, which would require
>: some subtle changes to the way sysctl works, but nothing too drastic.
> 
> I'd like to see that as well.  I'd also like to see the hints settable
> after boot so that you can tweak things.  But they are close to
> sysctls in many ways (except for the API for getting the data).
> 
> One problem is that sysctl is readable by the whole world and root can
> write anything.  This is both too permissive and too strict.

This is why I think ACL's for sysctl's that are administered via a sysctlfs
wouldn't be such a bad thing.  However, sysctl(9) already allows for dynamic
addition, removal, setting, etc. of nodes already, so simply importing the
kernel environment into the sysctl tree at boot might be the easiest thing to
do.  However, I think that, say, hw.snd.pcm0.hwvol_mixer, is more of a hardware
attribute then a kernel environment attribute, which env.hint.pcm.0.hwvol_mixer
kind of implies.  I don't see env as being a good dumping ground for hardware
configuration, so I'd almost rather have devices export any important
information via a sysctl that lives in the proper part of the sysctl tree
rather than just stuck under env.  Also, for dynamic sysctl's, it is easier to
use 'pcm0' for a node than a '0' node under a 'pcm' tree.  This is because
device_get_nameunit() gives us a string we can just pass to sysctl_add_oid(),
whereas device_get_unit() returns an integer that we'd have to malloc a string
for and sprintf() into or something.  (I guess we could do _really_ evil things
where we return a pointer into the nameunit string that starts with the unit
number).

> Warner

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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