macOS: preserve FUSE service identity in fallback metadata

Generate the session serial before forking and reuse it in the service
and fallback mount metadata.

This keeps PR #1866's shutdown identity check consistent when control
metadata cannot be read.
This commit is contained in:
Mounir IDRASSI committed 2026-09-26 03:38:01 +02:00
1 parent dbfd67d4c1
commit 23d4452f5b
3 files changed
+24 -11

No files matched your search

+9 -3
View File
@@ -1169,9 +1169,17 @@ namespace VeraCrypt
}
}
#ifdef VC_MACOSX_FUSET
uint64 fuseServiceSerialInstanceNumber;
#endif
try
{
#ifdef VC_MACOSX_FUSET
fuseServiceSerialInstanceNumber = FuseService::Mount (volume, options.SlotNumber, fuseMountPoint);
#else
FuseService::Mount (volume, options.SlotNumber, fuseMountPoint);
#endif
}
catch (...)
{
@@ -1295,9 +1303,7 @@ namespace VeraCrypt
mountedVolume->AuxMountPoint = fuseMountPoint;
mountedVolume->VirtualDevice = mountedVirtualDevice;
struct timeval tv;
gettimeofday (&tv, NULL);
mountedVolume->SerialInstanceNumber = (uint64) tv.tv_sec * 1000000ULL + tv.tv_usec;
mountedVolume->SerialInstanceNumber = fuseServiceSerialInstanceNumber;
if (!options.NoFilesystem)
{