Because if we reject invalid sysctl names, then we'll have to perform the
escaping in (potentially many) more places.  The only source of invalid
sysctl names that I know of are ZFS pools.

ZFS does allow space in pool names, and sysctl(8) works with spaces as long
as you quote them on the command line.  It does not allow tabs or
newlines.  I didn't check any other nonprintable characters.  We can
certainly add other characters to the escape list if needed.
-Alan

On Thu, Jul 22, 2021 at 10:32 AM Hans Petter Selasky <h...@selasky.org>
wrote:

> On 7/22/21 6:23 PM, Alan Somers wrote:
> > commit 6c9506559080da2914749bf611225d7c0a153609
> > Author:     Alan Somers<asom...@freebsd.org>
> > AuthorDate: 2021-07-21 21:11:00 +0000
> > Commit:     Alan Somers<asom...@freebsd.org>
> > CommitDate: 2021-07-22 16:22:48 +0000
>
> If the strings come from user-input or hardware, why not just allow a-z
> and 0-9 and a few other characters?
>
> There are surely more illegal characters than just '.', like \n \r \t
> <space> that we don't want to see in sysctl names.
>
> --HPS
>
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to