Bug 114847

Summary: [ntfs] [patch] [request] dirmask support for NTFS ala MSDOSFS
Product: Base System Reporter: Ighighi <ighighi>
Component: kernAssignee: freebsd-fs (Nobody) <fs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: jhb, joeb1
Priority: Normal    
Version: 6.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.txt
none
ntfs_vnops.c.patch
none
ntfs_dirmask.patch none

Description Ighighi 2007-07-24 05:20:01 UTC
The "-m mask" option alone is useless since we are forced to add the
executable bits to browse directories, but these bits make no sense on
regular files in NTFS volumes most of the time.

Example code taken from src/sys/fs/msdosfs/* and src/sbin/mount_msdosfs/*
It was successfully built and tested on 6.2-STABLE and known to patch correctly
on -CURRENT.

It changes the ABI of the kernel module so any applications that use
<fs/ntfs/ntfs.h> & <fs/ntfs/ntfsmount.h> may need to be recompiled.
I'm not aware of none (other than mount_ntfs(8), of course).
An alternative patch will be posted later that just adds executable bits
to every directory, that preserves ABI compatibility.

Fix: 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
  cp -f /sys/fs/ntfs/ntfs.h /usr/include/fs/ntfs/
  cp -f /sys/fs/ntfs/ntfsmount.h /usr/include/fs/ntfs/
  cd /usr/src/sbin/mount_ntfs
  make clean && make && make install clean
  kldunload -v ntfs
  kldload -v ntfs

Enjoy, you may use a line like this in /etc/fstab:
 /dev/ad0s1 /mnt/win ntfs ro,noexec,noatime,-m644,-M755 0 0



Patch attached with submission follows:
Comment 1 Ighighi 2007-07-24 05:55:40 UTC
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
Comment 2 Ighighi 2007-07-24 21:24:26 UTC
This new version of the patch addresses the bug I posted at:
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/114856
Comment 3 Ighighi 2007-07-24 21:41:04 UTC
This new version of the patch addresses the bug I posted at:
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/114856
Comment 4 Remko Lodder freebsd_committer freebsd_triage 2007-07-25 07:02:14 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

I think the FS list is a better place for this PR.
Comment 5 joeb1 2014-07-12 01:54:34 UTC
Close this pr.
6.2 is so far past EOL as this pr is now meaningless.
And ntfs has been removed from 10.0 base see
http://svnweb.freebsd.org/base/head/sbin/Makefile?view=log&pathrev=247665
Comment 6 John Baldwin freebsd_committer freebsd_triage 2014-08-11 18:37:32 UTC
NTFS has been removed from the base system.