Summary: | [zfs] incorrect parsing of sharenfs options in zfs (fsshare.c) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Martin Birgmeier <Martin.Birgmeier> | ||||||
Component: | kern | Assignee: | Rick Macklem <rmacklem> | ||||||
Status: | In Progress --- | ||||||||
Severity: | Affects Only Me | CC: | Robert.nr1, d8zNeCFG, eborisch+FreeBSD, gerrit.kuehn, max, rmacklem | ||||||
Priority: | Normal | ||||||||
Version: | Unspecified | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Martin Birgmeier
2012-05-20 08:30:01 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s). Hi, I just run into this exact bug with: FreeBSD 10.0-RELEASE-p12 FreeBSD 10.0-RELEASE-p12 What is the current status on this, is the "sharenfs" property overall simply not recommended nor used in production? (I also found this bug on the tracker: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=147881) I have read people recommending to just use /etc/exports instead, but most posts a quite old so I'm not sure what's recommended today. Regards, Robert Created attachment 158168 [details]
Patch to support hyphenated host names in sharenfs zfs property.
Simple patch that only ignores leading hyphens in options.
With this change:
'-ro,a-server -alldirs' -> '-ro a-server -alldirs'
instead of (current behavior):
'-ro,a-server -alldirs' -> '-ro a server -alldirs'
Changed by removing '-' from strsep() call, and handling (skipping) hyphen if first character immediately after strsep() call.
All test cases listed immediately prior to the code still work; I'm not aware of any supported forms that are broken by this change.
FreeBSD 11.0-STABLE, and still the same. Will the patch by eborisch be included? If I want to include it, do I have to rebuild the whole kernel, or is it enough to rebuild zfs.ko? Now that this probably starts moving again, may I humbly suggest to use my patch instead for the reasons cited in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=176449#c7 -- Martin batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed. I just ran across this problem (not able to set hostnames with hyphen/dash using zfs set sharenfs=...) with a recent FreeBSD 14.1. Is there are chance that this will be fixed? Created attachment 252620 [details]
fix ZFS sharenfs for DNS names with '-' in them
Here is the same patch at Martin's, but for
current sources.
I will try and get it pulled into OpenZFS.
(I'm doing this now, but for future reference,
anyone can do a OpenZFS pull request. All you
need is a github login.)
I have made the pull request for the patch on OpenZFS. I have no idea if/when it will happen. Just fyi, the patch has now been pulled into OpenZFS. It should end up in FreeBSD's main, etc when the next cycle of downstream pulls occur. Rick, thank you for your efforts. Good things take time! :-) -- Martin The patch has now been pulled down into FreeBSD's main. I'll close this patch once it is MFC'd. |