NetBSD Problem Report #2556

From gnats  Mon Jun 17 14:37:10 1996
Received: from zappa.unna.ping.de by pain.lcs.mit.edu (8.7.5/8.7.3) with ESMTP id OAA02696 for <gnats-bugs@gnats.netbsd.org>; Mon, 17 Jun 1996 14:12:13 -0400 (EDT)
Message-Id: <199606171811.UAA26276@zappa.unna.ping.de>
Date: Mon, 17 Jun 1996 20:11:58 +0200 (MET DST)
From: oskar@unna.ping.de
Reply-To: oskar@unna.ping.de
To: gnats-bugs@NetBSD.ORG
Subject: mountd ALLDIRS deficiency
X-Send-Pr-Version: 3.95

>Number:         2556
>Category:       bin
>Synopsis:       mountd ALLDIRS deficiency
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 17 14:50:01 +0000 1996
>Closed-Date:    Sun Jun 26 06:35:53 +0000 2016
>Last-Modified:  Sun Jun 26 06:35:53 +0000 2016
>Originator:     Jan-Hinrich Fessel
>Release:        19960615
>Organization:
Jan-Hinrich Fessel	fessel@quantum.de		oskar@unna.ping.de
"There are two major products that come out of Berkeley: LSD and BSD UNIX.
 We don't believe this to be a coincidence."
	- Andrew Bulhak (acb@yoyo.cc.monash.edu.au)
>Environment:

System: NetBSD zappa.unna.Ping.DE 1.1A NetBSD 1.1A (ZAPPA) #52: Sat Mar 16 13:53:02 MET 1996 oskar@zappa.unna.Ping.DE:/usr/src/sys/arch/i386/compile/ZAPPA i386


>Description:
	The -alldirs option to mountd (in /etc/exports) is only usable if the directrory
	to be exported is a directory a filesystem is mounted on, e.g 
	/dev/sd1g                   249151   224938    11755    95%    /usr/local
	can be exported with -alldirs, /usr/local/faces fails to be exported -alldirs.
>How-To-Repeat:
	zappa# df
	Filesystem               1K-blocks     Used    Avail Capacity  Mounted on
	/dev/sd0a                    16415    12841     2753    82%    /
	kernfs                           1        1        0   100%    /kern
	procfs                           4        4        0   100%    /proc
	fdesc                            1        1        0   100%    /dev
	mfs:23                       26959     2585    23026    10%    /tmp
	/dev/sd0g                   180735   105872    65826    62%    /usr
	/dev/sd1g                   249151   224938    11755    95%    /usr/local
	/dev/sd0e                  1314541   700505   548308    56%    /usr/src
	/dev/sd1h                   322182   274714    31358    90%    /export/home
	/dev/sd1f                   409896   180864   208537    46%    /var
	/dev/sd1a                    16055     1851    13401    12%    /var/spool/uucp
	/dev/sd0h                   412639   325584    66423    83%    /export/ftp
	amd:84                           0        0        0   100%    /cdrom
	amd:84                           0        0        0   100%    /home
	zippo:/export/home/oskar    301141   197511    88572    69%    /amd/zippo/export/home/oskar
	zappa# cat /etc/exports
	/export/ftp     -alldirs -maproot=root 193.100.14.22 193.100.14.21 193.100.14.19 193.100.14.18
	/usr/src        -alldirs -maproot=root 193.100.14.22 193.100.14.19 193.100.14.18
	/usr/local/faces        -alldirs
	/xwin           -maproot=root 193.100.14.22 193.100.14.18
	/export/home            -maproot=root 193.100.14.22 193.100.14.18
	/cdrom          -ro
	zappa# mountd -d
	Getting export list.
	Got line /export/ftp    -alldirs -maproot=root 193.100.14.22 193.100.14.21 193.100.14.19 193.100.14.18
	Making new ep fs=0x407,0x78b
	doing opt -alldirs -maproot=root 193.100.14.22 193.100.14.21 193.100.14.19 193.100.14.18
	doing opt -maproot=root 193.100.14.22 193.100.14.21 193.100.14.19 193.100.14.18
	got host 193.100.14.22
	got host 193.100.14.21
	got host 193.100.14.19
	got host 193.100.14.18
	Got line /usr/src       -alldirs -maproot=root 193.100.14.22 193.100.14.19 193.100.14.18
	Making new ep fs=0x404,0x78b
	doing opt -alldirs -maproot=root 193.100.14.22 193.100.14.19 193.100.14.18
	doing opt -maproot=root 193.100.14.22 193.100.14.19 193.100.14.18
	got host 193.100.14.22
	got host 193.100.14.19
	got host 193.100.14.18
	Got line /usr/local/faces       -alldirs
	Making new ep fs=0x40e,0x78b
	doing opt -alldirs
	Adding a default entry
	Got line /xwin          -maproot=root 193.100.14.22 193.100.14.18
	Making new ep fs=0x400,0x78b
	doing opt -maproot=root 193.100.14.22 193.100.14.18
	got host 193.100.14.22
	got host 193.100.14.18
	Got line /export/home           -maproot=root 193.100.14.22 193.100.14.18
	Making new ep fs=0x40f,0x78b
	doing opt -maproot=root 193.100.14.22 193.100.14.18
	got host 193.100.14.22
	got host 193.100.14.18
	Got line /cdrom         -ro
	Making new ep fs=0x1c01,0x70b
	doing opt -ro
	Adding a default entry
	Getting mount list.
	Here we go.
	Jun 17 20:08:44 zappa mountd[26107]: Could not remount /usr/local/faces: Invalid argument
	Jun 17 20:08:44 zappa mountd[26107]: Bad exports list line /usr/local/faces     -alldirs

	This is espacially annoying when using amd on homedirs on the other end...

>Fix:

	temporary hack: just allow the mount, regardless what the mount call to
	update the kernel says, if we export -alldirs:

diff -c mountd.c~ mountd.c
*** mountd.c~   Mon Jun 17 20:00:08 1996
--- mountd.c    Mon Jun 17 19:58:08 1996
***************
*** 1606,1612 ****
--- 1606,1614 ----
                        if (opt_flags & OP_ALLDIRS) {
                                syslog(LOG_ERR, "Could not remount %s: %m",
                                        dirp);
+                               /*
                                return (1);
+                               */
                        }
                        /* back up over the last component */
                        while (*cp == '/' && cp > dirp)


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 26 Jun 2016 06:35:53 +0000
State-Changed-Why:
This is intentional as explained in exports(5), because export permissions
are per-volume and not per-subtree. If that is ever fixed (there's a PR on
it but don't hold your breath) the behavior of -alldirs will change
accordingly.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.