From owner-freebsd-bugs@FreeBSD.ORG Tue Jul 24 05:00:16 2007 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 3EE4716A41A for ; Tue, 24 Jul 2007 05:00:16 +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 18A2413C467 for ; Tue, 24 Jul 2007 05:00:16 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l6O50Fs7055031 for ; Tue, 24 Jul 2007 05:00:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l6O50F14055030; Tue, 24 Jul 2007 05:00:15 GMT (envelope-from gnats) Date: Tue, 24 Jul 2007 05:00:15 GMT Message-Id: <200707240500.l6O50F14055030@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ighighi Cc: Subject: Re: kern/114847: [PATCH]: dirmask support for NTFS ala MSDOSFS X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ighighi List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2007 05:00:16 -0000 The following reply was made to PR kern/114847; it has been noted by GNATS. From: Ighighi To: bug-followup@freebsd.org Cc: Subject: Re: kern/114847: [PATCH]: dirmask support for NTFS ala MSDOSFS Date: Tue, 24 Jul 2007 00:55:40 -0400 This is a multi-part message in MIME format. --------------000100080803040209010208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch adds search permissions to directories on NTFS volumes so you don't need to add them to the "-m mask" option in mount_ntfs(8) since those permissions most likely make no sense on regular files anyway. It preserves ABI compatibility. To apply this patch, run: patch -d /usr < /path/do/patch Now, either rebuild the world and the kernel or run: cd /usr/src/sys/modules/ntfs make clean && make && make install clean kldunload -v ntfs kldload -v ntfs Enjoy, you may now use -m644 in /etc/fstab and still browse directories: /dev/ad0s1 /mnt/win ntfs ro,noexec,noatime,-m644 0 0 --------------000100080803040209010208 Content-Type: text/x-patch; name="ntfs_vnops.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ntfs_vnops.c.patch" # # (!c) 2007 by Ighighi # # This patch adds search permissions to directories on NTFS volumes so # you don't need to add them to the "-m mask" option in mount_ntfs(8) # since those permissions most likely make no sense on files anyway... # # To apply this patch, run: # patch -d /usr < /path/do/patch # Now, either rebuild the world and the kernel or run: # cd /usr/src/sys/modules/ntfs # make clean && make && make install clean # kldunload -v ntfs # kldload -v ntfs # # Enjoy, you may now use -m644 in /etc/fstab and still browse directories: # /dev/ad0s1 /mnt/win ntfs ro,noexec,noatime,-m644 0 0 # --- src/sys/fs/ntfs/ntfs_vnops.c.orig 2006-11-15 21:47:02.000000000 -0400 +++ src/sys/fs/ntfs/ntfs_vnops.c 2007-07-23 19:29:09.000000000 -0400 @@ -187,6 +187,8 @@ vap->va_fsid = dev2udev(ip->i_dev); vap->va_fileid = ip->i_number; vap->va_mode = ip->i_mp->ntm_mode; + if (vp->v_type == VDIR) + vap->va_mode |= (VEXEC | VEXEC >> 3 | VEXEC >> 6); vap->va_nlink = (ip->i_nlink || ip->i_flag & IN_LOADED ? ip->i_nlink : 1); vap->va_uid = ip->i_mp->ntm_uid; vap->va_gid = ip->i_mp->ntm_gid; @@ -392,13 +394,17 @@ { struct vnode *vp = ap->a_vp; struct ntnode *ip = VTONT(vp); - mode_t mode = ap->a_mode; + mode_t file_mode, mode = ap->a_mode; #ifdef QUOTA int error; #endif dprintf(("ntfs_access: %d\n",ip->i_number)); + file_mode = ip->i_mp->ntm_mode; + if (vp->v_type == VDIR) + file_mode |= (S_IXUSR | S_IXGRP | S_IXOTH); + /* * Disallow write attempts on read-only filesystems; * unless the file is a socket, fifo, or a block or @@ -419,7 +425,7 @@ } } - return (vaccess(vp->v_type, ip->i_mp->ntm_mode, ip->i_mp->ntm_uid, + return (vaccess(vp->v_type, file_mode, ip->i_mp->ntm_uid, ip->i_mp->ntm_gid, ap->a_mode, ap->a_cred, NULL)); } --------------000100080803040209010208--