mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-31 04:14:21 +03:00
Fix handling of DNS names with '-' in them for sharenfs
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 #16529
This commit is contained in:
parent
c25d5140b0
commit
2dc8529d9a
@ -85,7 +85,9 @@ translate_opts(const char *shareopts, FILE *out)
|
|||||||
strlcpy(oldopts, shareopts, sizeof (oldopts));
|
strlcpy(oldopts, shareopts, sizeof (oldopts));
|
||||||
newopts[0] = '\0';
|
newopts[0] = '\0';
|
||||||
s = oldopts;
|
s = oldopts;
|
||||||
while ((o = strsep(&s, "-, ")) != NULL) {
|
while ((o = strsep(&s, ", ")) != NULL) {
|
||||||
|
if (o[0] == '-')
|
||||||
|
o++;
|
||||||
if (o[0] == '\0')
|
if (o[0] == '\0')
|
||||||
continue;
|
continue;
|
||||||
for (i = 0; i < ARRAY_SIZE(known_opts); ++i) {
|
for (i = 0; i < ARRAY_SIZE(known_opts); ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user