MacOSX: Correctly detect newer versions of OSXFuse

This commit is contained in:
Mounir IDRASSI 2016-02-21 00:47:48 +01:00
parent b331668c06
commit faf00ca1e0

24
src/Core/Unix/MacOSX/CoreMacOSX.cpp Normal file → Executable file
View File

@ -124,19 +124,21 @@ namespace VeraCrypt
fuseVersionStringLength = MAXHOSTNAMELEN;
if ((status = sysctlbyname ("osxfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0)
{
throw HigherFuseVersionRequired (SRC_POS);
fuseVersionStringLength = MAXHOSTNAMELEN;
if ((status = sysctlbyname ("vfs.generic.osxfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0)
{
throw HigherFuseVersionRequired (SRC_POS);
}
}
// look for compatibility mode
struct stat sb;
if ((0 == stat("/usr/local/lib/libfuse.dylib", &sb)) && (0 == stat("/Library/Frameworks/MacFUSE.framework/MacFUSE", &sb)))
{
bIsOSXFuse = true;
}
else
{
// look for compatibility mode
struct stat sb;
if ((0 == stat("/usr/local/lib/libfuse.dylib", &sb)) && (0 == stat("/Library/Frameworks/MacFUSE.framework/MacFUSE", &sb)))
{
bIsOSXFuse = true;
}
else
throw HigherFuseVersionRequired (SRC_POS);
}
throw HigherFuseVersionRequired (SRC_POS);
}