From 7d6347f468050309d8b85089c13dd6d008297801 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 29 Sep 2016 15:41:19 +0200 Subject: MacOSX: remove MacFUSE dependency and link against OSXFuse library. Now, only standard OSXFuse install is needed without MacFUSE compatibility option. --- src/Core/Unix/MacOSX/CoreMacOSX.cpp | 32 ++++++++--------------- src/Main/Main.make | 5 +++- src/Main/UserInterface.cpp | 2 +- src/Setup/MacOSX/veracrypt.pkgproj | 51 ++----------------------------------- 4 files changed, 17 insertions(+), 73 deletions(-) diff --git a/src/Core/Unix/MacOSX/CoreMacOSX.cpp b/src/Core/Unix/MacOSX/CoreMacOSX.cpp index e7572e68..de801106 100644 --- a/src/Core/Unix/MacOSX/CoreMacOSX.cpp +++ b/src/Core/Unix/MacOSX/CoreMacOSX.cpp @@ -119,27 +119,20 @@ namespace VeraCrypt int status; bool bIsOSXFuse = false; - if ((status = sysctlbyname ("macfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0) + if ((status = sysctlbyname ("osxfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0) { fuseVersionStringLength = MAXHOSTNAMELEN; - if ((status = sysctlbyname ("osxfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0) + if ((status = sysctlbyname ("vfs.generic.osxfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0) { - 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 throw HigherFuseVersionRequired (SRC_POS); + } + } + // look for OSXFuse dynamic library + struct stat sb; + if (0 != stat("/usr/local/lib/libosxfuse_i64.2.dylib", &sb)) + { + throw HigherFuseVersionRequired (SRC_POS); } vector fuseVersion = StringConverter::Split (string (fuseVersionString), "."); @@ -149,12 +142,7 @@ namespace VeraCrypt uint32 fuseVersionMajor = StringConverter::ToUInt32 (fuseVersion[0]); uint32 fuseVersionMinor = StringConverter::ToUInt32 (fuseVersion[1]); - if (bIsOSXFuse) - { - if (fuseVersionMajor < 2 || (fuseVersionMajor == 2 && fuseVersionMinor < 5)) - throw HigherFuseVersionRequired (SRC_POS); - } - else if (fuseVersionMajor < 1 || (fuseVersionMajor == 1 && fuseVersionMinor < 3)) + if (fuseVersionMajor < 2 || (fuseVersionMajor == 2 && fuseVersionMinor < 5)) throw HigherFuseVersionRequired (SRC_POS); // Mount volume image diff --git a/src/Main/Main.make b/src/Main/Main.make index f4f254e1..8f223517 100644 --- a/src/Main/Main.make +++ b/src/Main/Main.make @@ -106,8 +106,11 @@ endif #------ FUSE configuration ------ +ifeq "$(PLATFORM)" "MacOSX" +FUSE_LIBS = $(shell pkg-config osxfuse --libs) +else FUSE_LIBS = $(shell pkg-config fuse --libs) - ++endif #------ Executable ------ diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index 8d4b701a..978a0375 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -493,7 +493,7 @@ namespace VeraCrypt EX2MSG (UnsupportedTrueCryptFormat, LangString["UNSUPPORTED_TRUECRYPT_FORMAT"]); #ifdef TC_MACOSX - EX2MSG (HigherFuseVersionRequired, _("VeraCrypt requires OSXFUSE 2.3 or later with MacFUSE compatibility layer installer.\nPlease ensure that you have selected this compatibility layer during OSXFUSE installation.")); + EX2MSG (HigherFuseVersionRequired, _("VeraCrypt requires OSXFUSE 2.5 or above.")); #endif #undef EX2MSG diff --git a/src/Setup/MacOSX/veracrypt.pkgproj b/src/Setup/MacOSX/veracrypt.pkgproj index 3eb42385..fe883f48 100755 --- a/src/Setup/MacOSX/veracrypt.pkgproj +++ b/src/Setup/MacOSX/veracrypt.pkgproj @@ -790,7 +790,7 @@ SECONDARY_VALUE VALUE - OSXFuse seems to be missing on your machine. VeraCrypt requires OSXFuse 2.3 or above. + OSXFuse seems to be missing on your machine. VeraCrypt requires OSXFuse 2.5 or above. Please download the latest OSXFuse version from : https://osxfuse.github.io/ @@ -800,7 +800,7 @@ https://osxfuse.github.io/ SECONDARY_VALUE VALUE - OSXFuse semble ne pas être installé sur votre machine. VeraCrypt nécessite OSXFuse 2.3 ou supérieur. + OSXFuse semble ne pas être installé sur votre machine. VeraCrypt nécessite OSXFuse 2.5 ou supérieur. Merci de télécharger la dernière version de OSXFuse à partir de : https://osxfuse.github.io/ @@ -812,53 +812,6 @@ https://osxfuse.github.io/ STATE - - BEHAVIOR - 3 - DICTIONARY - - IC_REQUIREMENT_FILES_CONDITION - 0 - IC_REQUIREMENT_FILES_DISK_TYPE - 1 - IC_REQUIREMENT_FILES_LIST - - /Library/Frameworks/MacFUSE.framework/MacFUSE - /usr/local/lib/libfuse.dylib - - IC_REQUIREMENT_FILES_SELECTOR - 1 - - IC_REQUIREMENT_CHECK_TYPE - 0 - IDENTIFIER - fr.whitebox.Packages.requirement.files - MESSAGE - - - LANGUAGE - English - SECONDARY_VALUE - - VALUE - VeraCrypt needs OSXFUSE to be installed with MacFUSE compatibility layer enabled. -Please re-install OSXFUSE and check the MacFUSE compatibility layer in the installer. - - - LANGUAGE - French - SECONDARY_VALUE - - VALUE - VeraCrypt nécessite que OSXFUSE soit installé avec l'option "MacFUSE compatibility layer". -Merci de ré-installer OSXFUSE et de cocher l'option de compatibilité MacFUSE dans l'installeur. - - - NAME - MacFUSE compatibility layer - STATE - - POSTINSTALL_PATH -- cgit v1.2.3