VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Unix/MacOSX/CoreMacOSX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/Unix/MacOSX/CoreMacOSX.cpp')
-rw-r--r--src/Core/Unix/MacOSX/CoreMacOSX.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/Core/Unix/MacOSX/CoreMacOSX.cpp b/src/Core/Unix/MacOSX/CoreMacOSX.cpp
index 251e4c65..cfd34072 100644
--- a/src/Core/Unix/MacOSX/CoreMacOSX.cpp
+++ b/src/Core/Unix/MacOSX/CoreMacOSX.cpp
@@ -107,12 +107,19 @@ namespace VeraCrypt
void CoreMacOSX::CheckFilesystem (shared_ptr <VolumeInfo> mountedVolume, bool repair) const
{
list <string> args;
- args.push_back ("/Applications/Utilities/Disk Utility.app");
+ struct stat sb;
+
+ if (stat("/Applications/Utilities/Disk Utility.app", &sb) == 0)
+ args.push_back ("/Applications/Utilities/Disk Utility.app");
+ else
+ args.push_back ("/System/Applications/Utilities/Disk Utility.app");
+
Process::Execute ("open", args);
}
void CoreMacOSX::MountAuxVolumeImage (const DirectoryPath &auxMountPoint, const MountOptions &options) const
{
+#ifndef VC_MACOSX_FUSET
// Check FUSE version
char fuseVersionString[MAXHOSTNAMELEN + 1] = { 0 };
size_t fuseVersionStringLength = MAXHOSTNAMELEN;
@@ -123,13 +130,17 @@ namespace VeraCrypt
fuseVersionStringLength = MAXHOSTNAMELEN;
if ((status = sysctlbyname ("vfs.generic.osxfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0)
{
- throw HigherFuseVersionRequired (SRC_POS);
+ fuseVersionStringLength = MAXHOSTNAMELEN;
+ if ((status = sysctlbyname ("vfs.generic.macfuse.version.number", fuseVersionString, &fuseVersionStringLength, NULL, 0)) != 0)
+ {
+ throw HigherFuseVersionRequired (SRC_POS);
+ }
}
}
// look for OSXFuse dynamic library
struct stat sb;
- if (0 != stat("/usr/local/lib/libosxfuse_i64.2.dylib", &sb))
+ if (0 != stat("/usr/local/lib/libosxfuse_i64.2.dylib", &sb) && 0 != stat("/usr/local/lib/libfuse.dylib", &sb))
{
throw HigherFuseVersionRequired (SRC_POS);
}
@@ -143,7 +154,7 @@ namespace VeraCrypt
if (fuseVersionMajor < 2 || (fuseVersionMajor == 2 && fuseVersionMinor < 5))
throw HigherFuseVersionRequired (SRC_POS);
-
+#endif
// Mount volume image
string volImage = string (auxMountPoint) + FuseService::GetVolumeImagePath();
@@ -229,6 +240,6 @@ namespace VeraCrypt
}
}
- auto_ptr <CoreBase> Core (new CoreServiceProxy <CoreMacOSX>);
- auto_ptr <CoreBase> CoreDirect (new CoreMacOSX);
+ unique_ptr <CoreBase> Core (new CoreServiceProxy <CoreMacOSX>);
+ unique_ptr <CoreBase> CoreDirect (new CoreMacOSX);
}