mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Linux: Fix wrong max size for hidden volume in CLI direct mode creation
There was a logical bug that made the code check the filesystem size of the device path "/dev" instead of using the actual size of the device Fix #1180
This commit is contained in:
@@ -656,6 +656,12 @@ namespace VeraCrypt
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint64 AvailableDiskSpace = 0;
|
uint64 AvailableDiskSpace = 0;
|
||||||
|
if (options->Path.IsDevice())
|
||||||
|
{
|
||||||
|
AvailableDiskSpace = maxVolumeSize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
wxLongLong diskSpace = 0;
|
wxLongLong diskSpace = 0;
|
||||||
wxString parentDir = wxFileName (wstring (options->Path)).GetPath();
|
wxString parentDir = wxFileName (wstring (options->Path)).GetPath();
|
||||||
if (parentDir.IsEmpty())
|
if (parentDir.IsEmpty())
|
||||||
@@ -668,6 +674,7 @@ namespace VeraCrypt
|
|||||||
if (maxVolumeSize > AvailableDiskSpace)
|
if (maxVolumeSize > AvailableDiskSpace)
|
||||||
maxVolumeSize = AvailableDiskSpace;
|
maxVolumeSize = AvailableDiskSpace;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (options->Size == (uint64) (-1))
|
if (options->Size == (uint64) (-1))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user