Skip to content

Commit 250a488

Browse files
committed
macOS: Use SMB backend for FUSE-T auxiliary mounts
1 parent 9877320 commit 250a488

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎src/Core/Unix/CoreUnix.cpp‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,10 @@ namespace VeraCrypt
342342
continue;
343343

344344
shared_ptr <VolumeInfo> mountedVol;
345-
// Introduce a retry mechanism with a timeout for control file access
346-
// This workaround is limited to FUSE-T mounted volume under macOS for
347-
// which md.Device starts with "fuse-t:"
345+
// Introduce a retry mechanism with a timeout for control file access.
346+
// The list is already filtered to VeraCrypt auxiliary mounts; in
347+
// FUSE-T builds, the mount table device name varies by backend.
348348
#ifdef VC_MACOSX_FUSET
349-
bool isFuseT = wstring(mf.Device).find(L"fuse-t:") == 0;
350349
int controlFileRetries = 10; // 10 retries with 500ms sleep each, total 5 seconds
351350
while (!mountedVol && (controlFileRetries-- > 0))
352351
#endif
@@ -366,7 +365,7 @@ namespace VeraCrypt
366365
// serialization is not ready yet and we need to wait before retrying
367366
// this happens when FUSE-T is used under macOS and if it is the first time
368367
// the volume is mounted
369-
if (isFuseT && string (e.what()).find ("VeraCrypt::Serializer::ValidateName") != string::npos)
368+
if (string (e.what()).find ("VeraCrypt::Serializer::ValidateName") != string::npos)
370369
{
371370
Thread::Sleep(500); // Wait before retrying
372371
}

‎src/Driver/Fuse/FuseService.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,17 @@ namespace VeraCrypt
533533
args.push_back ("-o");
534534
args.push_back ("nobrowse");
535535

536+
#ifdef VC_MACOSX_FUSET
537+
// Use FUSE-T's SMB backend for the auxiliary mount. The default NFS
538+
// backend can be affected by macOS Network Volumes privacy state.
539+
args.push_back ("-o");
540+
args.push_back ("backend=smb");
541+
args.push_back ("-o");
542+
args.push_back ("nonamedattr");
543+
args.push_back ("-o");
544+
args.push_back ("rwsize=262144");
545+
#endif
546+
536547
if (getuid() == 0 || geteuid() == 0)
537548
#endif
538549
{

0 commit comments

Comments
 (0)