Tuesday, January 19, 2010

CYGWIN=nontsec in Cygwin 1.7-speak

Cygwin has always royally screwed up NTFS permissions for new files. For some reason it duplicates a new set of permissions for every file instead of inheriting from the parent (some impedance mismatch between POSIX and NT semantics, oh well). CYGWIN=nontsec allowed me (in Cygwin 1.5) to disable this and create files with (Windows) default permissions.

But, alas, Cygwin 1.7 rolled around and now to achieve the same thing we have to muck with /etc/fstab. This is probably a better solution in the long run, as configuration through environment variables is a bit of a mess.
D:/cygwin/bin   /usr/bin    ntfs        binary,auto,noacl           0   0
D:/cygwin/lib /usr/lib ntfs binary,auto,noacl 0 0
D:/cygwin / ntfs override,binary,auto,noacl 0 0
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0

Replace D:/cygwin with your install directory. Note the "noacl" at the end of all the mount options. "override" is necessary for the root directory because Cygwin's default mount point is "immutable" (mount.cc line 342).