>Number:         168158
>Category:       misc
>Synopsis:       incorrect parsing of sharenfs options in zfs (fsshare.c)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 20 07:30:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Martin Birgmeier
>Release:        9.0.0, 8.2.0
>Organization:
MBi at home
>Environment:
FreeBSD hal.xyzzy 8.2-RELEASE FreeBSD 8.2-RELEASE #4: Sat Aug 27 09:30:11 CEST 
2011     
root@hal.xyzzy:/z/OBJ/FreeBSD/amd64/RELENG_8_2_0_RELEASE/src/sys/XYZZY_SMP  
amd64
>Description:
The function translate_opts() in cddl/compat/opensolaris/misc/fsshare.c 
incorrectly transforms nfs export options. Specifically, it unconditionally 
separates the input string along hyphens, thereby making it impossible to have 
a hyphen in a host name (which is allowed, cf. 
http://tools.ietf.org/html/rfc952 and http://tools.ietf.org/html/rfc1123).

I am not sure whether this parsing is needed at all, as the resultant string, 
which is parsed by mountd(8), in its unaltered form seems to be compatible with 
the syntax expected by the latter. In fact, one could simply require that the 
string used for the sharenfs option is mountd(8) compatible and do away with 
the translate_opts() function entirely.

In a related vein, it is absolutely necessary to be able to specify multiple 
export lines for a single mount point, thereby allowing to assign different 
permissions to different clients. This has already been proposed a long while 
ago in http://www.freebsd.org/cgi/query-pr.cgi?pr=147881 but never been 
implemented. May I use that PR to suggest that this feature be added at the 
same time as fixing the bug described here.

>How-To-Repeat:
Try to execute

    zfs set sharenfs=test-host <zfs volume>

and then do a

    zfs list -o name,sharenfs <zfs colume>

>Fix:
Correct translate_opts() in cddl/compat/opensolaris/misc/fsshare.c (or get rid 
of it altogether).

As a workaround, I am currently using IP addresses in lieu of the affectd host 
names. I need to use both IPv4 and IPv6 addresses of the same host, as my 
network runs both IPv4 and IPv6.


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to