From owner-freebsd-bugs@FreeBSD.ORG Sun May 20 07:30:03 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C7861065670 for ; Sun, 20 May 2012 07:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C58FB8FC14 for ; Sun, 20 May 2012 07:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4K7U2ml044840 for ; Sun, 20 May 2012 07:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4K7U2cQ044839; Sun, 20 May 2012 07:30:02 GMT (envelope-from gnats) Resent-Date: Sun, 20 May 2012 07:30:02 GMT Resent-Message-Id: <201205200730.q4K7U2cQ044839@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Birgmeier Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F1C106564A for ; Sun, 20 May 2012 07:23:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 18F1F8FC0A for ; Sun, 20 May 2012 07:23:29 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K7NSr9090018 for ; Sun, 20 May 2012 07:23:28 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q4K7NRU3090017; Sun, 20 May 2012 07:23:27 GMT (envelope-from nobody) Message-Id: <201205200723.q4K7NRU3090017@red.freebsd.org> Date: Sun, 20 May 2012 07:23:27 GMT From: Martin Birgmeier To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/168158: incorrect parsing of sharenfs options in zfs (fsshare.c) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 07:30:03 -0000 >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 and then do a zfs list -o name,sharenfs >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: