Google Groups

Re: [OSXFUSE] OSXFUSE can't mount Truecrypt encrypted NTFS Volume because of a software error!

Benjamin Fleischer Apr 10, 2012 6:47 AM
Posted in group: OSXFUSE
Am 10.04.2012 um 13:40 schrieb Paweł Witas:

I'm using Hackintosh Hazard 10.6.8 (upgraded from 10.6.6), Tuxera NTFS 2010.1 and newest Truecrypt 7.1a. I checked on my laptop and desktop with OSXFuse modified to show filesystem type name in the error message.

I can confirm the TrueCrypt 7.1a + OSXFUSE 2.3.9 + Tuxera NTFS for Mac 2012.3 work on Mac OS X 10.6. You are using a very outdated version of Tuxera's NTFS driver. Please install the latest version.

My point is that the limit of only four characters for the filesystem type name is too small, maybe you are using another, shorter name than "txantfs" but there should be limit of 16 characters including \0, as stated in bsd/sys/mount.h, line 114 #define MFSTYPENAMELEN 16
I don't know what OSXFUSE_FS_TYPE (=10) is, but it is certainly something different than MFSTYPENAMELEN. If you concatenate two strings, please make sure that there is enough space for the result provided.

Please take a look at struct vfsstatfs in bsd/sys/mount.h.

struct vfsstatfs {
uint32_t f_bsize; /* fundamental file system block size */
size_t f_iosize; /* optimal transfer block size */
uint64_t f_blocks; /* total data blocks in file system */
uint64_t f_bfree; /* free blocks in fs */
uint64_t f_bavail; /* free blocks avail to non-superuser */
uint64_t f_bused; /* free blocks avail to non-superuser */
uint64_t f_files; /* total file nodes in file system */
uint64_t f_ffree; /* free file nodes in fs */
fsid_t f_fsid; /* file system id */
uid_t f_owner; /* user that mounted the filesystem */
uint64_t f_flags; /* copy of mount exported flags */ 
char f_fstypename[MFSTYPENAMELEN];/* fs type name inclus */
char f_mntonname[MAXPATHLEN];/* directory on which mounted */
char f_mntfromname[MAXPATHLEN];/* mounted filesystem */
uint32_t f_fssubtype;     /* fs sub-type (flavor) */
void *f_reserved[2]; /* For future use == 0 */

As you can see the f_fstypename field is limited to MFSTYPENAMELEN characters. You can't just increase that number. Your patch simply cuts off the last part of the type name. I'm not convinced that this is the right thing to do.

Am 10.04.2012 um 14:14 schrieb Paweł Witas:

And I've been trying to mount Truecrypt encrypted NTFS partitions, so I think that it is rather a problem with cooperation of Tuxera NTFS 2010.1 with OSXFuse, caused by this limit of 4 characters.

OSXFUSE has never been tested with this particular version of Tuxera's NTFS driver, at least not by me. Nonetheless I get your point about the 4 characters limit. The only way to "fix" this properly would be to shorten the prefix. Dropping  the prefix completely would break the ALLOW_RECURSION (recursive mounts) mechanism.