Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of DNS names with '-' in them for sharenfs #16529

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

rmacklem
Copy link
Contributor

Motivation and Context

Without this patch, the sharenfs property cannot have DNS names with '-' in them on FreeBSD.
This was reported to FreeBSD in a bugzilla report#168158 over 10 years ago.

Description

Change the parser slightly so that '-' no longer is an option separator and
then strip any leading '-' off of the option (since it is no longer stripped out
as a separator).

How Has This Been Tested?

Did a "zfs set sharenfs" with a '-' in the DNS name and then looked at
the resultant /etc/zfs/exports file.
The only negative effect might be that, if a bogus sharenfs setting used
'-' to separate options, it will no longer work with this patch.

Types of changes

  • [x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • [ x] My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly.
  • [ x] I have read the contributing document.
  • I have added tests to cover my changes.
  • [ x] I have run the ZFS Test Suite with this change applied.
  • [ x] All commit messages are properly formatted and contain Signed-off-by.

An old FreeBSD bugzilla report PR#168158 notes that DNS
names with '-'s in them cannot be used for the sharenfs
property.  This patch fixes the parsing of these DNS names.
The only negative affect this patch might have is that,
if a user has incorrectly separated options with a '-'
the sharenfs setting will no longer work once this patch
is applied.

Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think why "-" would be used as separator. I am a bit worrying about possible syntax change, but hopefully it makes more good than harm.

@rmacklem
Copy link
Contributor Author

rmacklem commented Sep 11, 2024 via email

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Sep 17, 2024
@behlendorf behlendorf merged commit 29c9e6c into openzfs:master Sep 17, 2024
21 of 23 checks passed
ptr1337 pushed a commit to CachyOS/zfs that referenced this pull request Nov 14, 2024
An old FreeBSD bugzilla report PR#168158 notes that DNS
names with '-'s in them cannot be used for the sharenfs
property.  This patch fixes the parsing of these DNS names.
The only negative affect this patch might have is that,
if a user has incorrectly separated options with a '-'
the sharenfs setting will no longer work once this patch
is applied.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
Closes openzfs#16529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants