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
Unknown Object (File)
Wed, Jan 15, 2:31 AM
Unknown Object (File)
Sun, Jan 12, 4:35 PM
Unknown Object (File)
Nov 20 2024, 9:12 PM
Unknown Object (File)
Nov 19 2024, 8:05 PM
Unknown Object (File)
Oct 13 2024, 5:14 PM
Unknown Object (File)
Oct 13 2024, 5:14 PM
Unknown Object (File)
Oct 13 2024, 8:08 AM
Unknown Object (File)
Oct 9 2024, 8:28 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