Page MenuHomeFreeBSD

Escape any '.' characters in sysctl node names
ClosedPublic

Authored by asomers on Jul 21 2021, 9:15 PM.
Tags
None
Referenced Files
F122019196: D31265.id92627.diff
Tue, Jul 1, 12:24 PM
Unknown Object (File)
Mon, Jun 30, 1:02 PM
Unknown Object (File)
Mon, Jun 30, 7:52 AM
Unknown Object (File)
Sat, Jun 28, 6:32 PM
Unknown Object (File)
Fri, Jun 27, 9:37 AM
Unknown Object (File)
Thu, Jun 26, 6:29 AM
Unknown Object (File)
Fri, Jun 20, 3:20 AM
Unknown Object (File)
Tue, Jun 17, 2:44 AM

Details

Summary

ZFS creates some sysctl nodes that include a pool name, and '.' is an
allowed character in pool names. But it's the separator in the sysctl
tree, so it can't be included in a sysctl name. Replace it with "%25".
Handily, "%" is illegal in ZFS pool names, so there's no ambiguity
there.

PR: 257316
MFC after: 3 weeks
Sponsored by: Axcient

Test Plan

manually tested

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

martin_lispworks.com added inline comments.
sys/kern/kern_sysctl.c
771

Is this 1 byte too short (no space for the nul)?

sys/kern/kern_sysctl.c
771

Yep.

  • Allow space for the trailing NUL

Seems reasonable to me.

sys/kern/kern_sysctl.c
765

Accumulating len is unnecessary since it's just i + 1, which you could do once outside of the loop.

This revision is now accepted and ready to land.Jul 22 2021, 3:57 PM