Linux: Only add disk to mountable devices if it doesn't have a partition. This fixes a strange issue where the function "open" would fail with error ENOENT (No such file or directory) on a partition (e.g. /dev/sdb1) if it was called previously on the main disk (e.g. /dev/sdb).

This commit is contained in:
Mounir IDRASSI 2017-11-29 17:26:23 +01:00
parent ee6da31fb6
commit 668d5e3cad
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC

View File

@ -596,11 +596,14 @@ namespace VeraCrypt
HostDeviceList devices; HostDeviceList devices;
foreach (shared_ptr <HostDevice> device, Core->GetHostDevices (true)) foreach (shared_ptr <HostDevice> device, Core->GetHostDevices (true))
{ {
if (device->Partitions.empty())
devices.push_back (device); devices.push_back (device);
else
{
foreach (shared_ptr <HostDevice> partition, device->Partitions) foreach (shared_ptr <HostDevice> partition, device->Partitions)
devices.push_back (partition); devices.push_back (partition);
} }
}
set <wstring> mountedVolumes; set <wstring> mountedVolumes;
foreach_ref (const VolumeInfo &v, Core->GetMountedVolumes()) foreach_ref (const VolumeInfo &v, Core->GetMountedVolumes())