mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-22 14:22:36 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user