From owner-freebsd-current@FreeBSD.ORG Mon Oct 6 01:16:56 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C57016A4BF for ; Mon, 6 Oct 2003 01:16:56 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01D9843FDF for ; Mon, 6 Oct 2003 01:16:55 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id SAA28329; Mon, 6 Oct 2003 18:16:41 +1000 Date: Mon, 6 Oct 2003 18:15:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Nate Lawson In-Reply-To: <20031005112505.J474@root.org> Message-ID: <20031006173858.Y8422@gamplex.bde.org> References: <20031005112505.J474@root.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@FreeBSD.org Subject: Re: msdosfs mask? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2003 08:16:56 -0000 On Sun, 5 Oct 2003, Nate Lawson wrote: > In the past, msdosfs has taken its permissions from the mountpoint. > Recently I noticed that this still works for files in the root directory > but subdirectories are all chmod 000. Has anyone else seen this? Adding > the -m=755 flag for instance does work for the files in the top of the > mountpoint (i.e. command.com) but not subdirectories, which are still 000. > What's going on? This still works for me. Perhaps your mount_msdosfs binary is out of date. Rev.1.25 of mount_msdosfs.c is required to keep up with corresponding kernel changes. It passes a separate mask for directories. Old versions of mount_msdosfs don't understand the new field for the directory mask in the args struct so they don't pass anything. More precisely, it happens that the new field fits in unnamed padding in the old args struct, so adding it didn't completely break binary compatibility with old mount_msdosfs binaries; all version fill memset the struct to 0 so they set unnamed padding to 0, so old versions do the equivalent of the new version when the latter is invoked with "-M 0". But a mask of 0 is rarely what is wanted. The compatibility problems can be fixed easily since the new field is in spare space and there is already a magic number and flags for version control. See also PR bin/57401 which has a quick fix for amd. The fix is wrong since it is under a wrong ifdef, and it shouldn't be necessary -- amd should work like an old mount_msdosfs binary and simply not pass a dirmask (by not setting a flag which that it passes one). amd could also use flags for saying that it doesn't pass a file mask or uid or gid... either. It always passes 0777 for the file mask and 0 for the ids instead of the attributes inherited from the mount point. Perhaps more of the logical for this should be in the kernel since applications get it wrong. Bruce