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
F152039321: D46247.diff
Sun, Apr 12, 7:14 AM
F151961555: D46247.diff
Sat, Apr 11, 7:21 PM
F151942054: D46247.diff
Sat, Apr 11, 4:11 PM
Unknown Object (File)
Sat, Apr 11, 11:04 AM
Unknown Object (File)
Fri, Apr 10, 4:16 PM
Unknown Object (File)
Mon, Mar 30, 3:07 PM
Unknown Object (File)
Tue, Mar 24, 1:45 PM
Unknown Object (File)
Mon, Mar 16, 1:22 PM

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