git: 6c9506559080 - main - Escape any '.' characters in sysctl node names

Alan Somers asomers at freebsd.org
Thu Jul 22 16:39:02 UTC 2021


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 <hps at selasky.org>
wrote:

> On 7/22/21 6:23 PM, Alan Somers wrote:
> > commit 6c9506559080da2914749bf611225d7c0a153609
> > Author:     Alan Somers<asomers at FreeBSD.org>
> > AuthorDate: 2021-07-21 21:11:00 +0000
> > Commit:     Alan Somers<asomers at 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
>


More information about the dev-commits-src-all mailing list