From faf00ca1e093f0240f3cc668532f38b15e268da3 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 21 Feb 2016 00:47:48 +0100 Subject: [PATCH] MacOSX: Correctly detect newer versions of OSXFuse --- src/Core/Unix/MacOSX/CoreMacOSX.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) mode change 100644 => 100755 src/Core/Unix/MacOSX/CoreMacOSX.cpp diff --git a/src/Core/Unix/MacOSX/CoreMacOSX.cpp b/src/Core/Unix/MacOSX/CoreMacOSX.cpp old mode 100644 new mode 100755 index 70dc3301..b2a10017 --- a/src/Core/Unix/MacOSX/CoreMacOSX.cpp +++ b/src/Core/Unix/MacOSX/CoreMacOSX.cpp @@ -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); }