From owner-freebsd-bugs@freebsd.org Sun Jul 10 09:44:08 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DA7B8384C for ; Sun, 10 Jul 2016 09:44:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1F511870 for ; Sun, 10 Jul 2016 09:44:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u6A9i89V032506 for ; Sun, 10 Jul 2016 09:44:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 210957] [PATCH] reject /etc/exports lines where the first field(s) end with a / Date: Sun, 10 Jul 2016 09:44:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.3-RELEASE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dereks@lifeofadishwasher.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2016 09:44:09 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210957 Bug ID: 210957 Summary: [PATCH] reject /etc/exports lines where the first field(s) end with a / Product: Base System Version: 10.3-RELEASE Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: dereks@lifeofadishwasher.com Keywords: patch Created attachment 172306 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D172306&action= =3Dedit reject FS fields that end with a / update exports man page If the last character in the file system fields (the first set of fields) f= rom /etc/exports ends with a / (other than root) then the exported nfs file sys= tem can't be mounted on a remote system. mountd(8) happily accepts lines from /etc/exports if the last character in = the file system fields is /. Other than / itself are there any valid cases whe= re the fs field should/can end with a /? NFS Server(nfssrv): # cat /etc/exports=20 /mnt/backups/isos -ro -mapall=3Dnobody -network 10..... NFS Client(nfscli): $ sudo mount nfssrv:/mnt/backups/isos/ /tmp/ mount_nfs: can't mount /mnt/backups/isos/ from nfssrv onto /private/tmp: Permission denied NFS Server rejecting a line with a FS ending with a /: ..... mountd[66457]: bad exports list line /mnt/backups/isos/ With patch mountd NFS Server from /var/log/messages: ........ mountd[17841]: mount request denied from nfscli for /mnt/backups/i= sos Removing the / fixes the issue. See the attached patch to update mountd.c:check_dirpath to reject lines and exports.5 explaining file system fields shouldn't end with / other than roo= t. I have only tested the patch with 10.3-RELEASE (nfs server) and Mac OS X (client). It seems this isn't a client issue (same problem with Linux NFS clients) based off other forum posts. Also, it appears the patch should apply to (10|11)-STABLE and CURRENT. --=20 You are receiving this mail because: You are the assignee for the bug.=