Page MenuHomeFreeBSD

Fix the ZFS sharenfs property for DNS names with '-'s in them
AcceptedPublic

Authored by rmacklem on Aug 8 2024, 11:55 PM.
Tags
None
Referenced Files
F142035685: D46247.id.diff
Thu, Jan 15, 6:16 AM
Unknown Object (File)
Thu, Jan 8, 7:09 AM
Unknown Object (File)
Dec 8 2025, 8:21 PM
Unknown Object (File)
Dec 5 2025, 6:13 PM
Unknown Object (File)
Dec 4 2025, 11:39 PM
Unknown Object (File)
Dec 4 2025, 11:39 PM
Unknown Object (File)
Dec 4 2025, 11:39 PM
Unknown Object (File)
Nov 25 2025, 4:05 AM

Details

Reviewers
mav
Summary

A 12 year old FreeBSD PR#168158 reports that the ZFS
sharenfs property does not parse correctly when there
is a '-' in a DNS host name.

This simple patch (based on the one in the PR authored
by Martin Birgmeier <Martin.Birgmiere@aon.at> fixes
the problem.

The only downside I can see w.r.t. this patch is that a
bogus set of options without any ',' or ' ' separating them,
works without the patch, but no longer works.
For example:
zfs set sharenfs='-ro-network=192.168.1.0-mask=255.255.255.0' example
works without the patch, but not with it.
Since zfsprops.7 specifies that ','s separate options, I do not think this
change is a problem.

Test Plan

Tested assorted settings for sharenfs, including ones
with nfsv4-foo2 as a hostname and they worked as
expected.

Once reviewed, I will set it up as a OpenZFS pull request.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Just fyi, I have created a Pull Request for this on OpenZFS,
so please review it over there.

Thanks, rick

This revision is now accepted and ready to land.Sep 11 2024, 2:48 PM