Linux: warn when a mounted volume depends on the requester's session

A volume file opened with the credentials of the requesting user is
served by a file system that belongs to that user's session. Ejecting
the share or logging out while the volume is mounted can lose data, and
GVfs does not refuse to eject a share whose file is in use. Warn after
each such mount that the share must stay mounted and the session active
until the volume is unmounted. Append the English message to all
language files as a fallback.

The indicator reaches the UI with the mount result, through a new
MountVolumeRequestV2/ResponseV2 pair: a service that predates it rejects
the new request before mounting, and legacy requests keep their legacy
response, so that an older UI still works with a newer service. The
control file format is unchanged.
This commit is contained in:
Mounir IDRASSI
2026-10-13 14:36:45 +09:00
parent eb9d10f430
commit 3e1c3f6490
51 changed files with 114 additions and 6 deletions
+12 -3
View File
@@ -1337,9 +1337,13 @@ namespace VeraCrypt
MountVolumeRequest *mountRequest = dynamic_cast <MountVolumeRequest*> (request.get());
if (mountRequest)
{
MountVolumeResponse (
Core->MountVolume (*mountRequest->Options)
).Serialize (outputStream);
shared_ptr <VolumeInfo> mountedVolume = Core->MountVolume (*mountRequest->Options);
#ifdef TC_LINUX
if (dynamic_cast <MountVolumeRequestV2*> (mountRequest))
MountVolumeResponseV2 (mountedVolume).Serialize (outputStream);
else
#endif
MountVolumeResponse (mountedVolume).Serialize (outputStream);
continue;
}
@@ -1454,8 +1458,13 @@ namespace VeraCrypt
shared_ptr <VolumeInfo> CoreService::RequestMountVolume (MountOptions &options)
{
#ifdef TC_LINUX
MountVolumeRequestV2 request (&options);
return SendRequest <MountVolumeResponseV2> (request)->MountedVolumeInfo;
#else
MountVolumeRequest request (&options);
return SendRequest <MountVolumeResponse> (request)->MountedVolumeInfo;
#endif
}
void CoreService::RequestSetFileOwner (const FilesystemPath &path, const UserId &owner)