Linux: Overwriting file container allows you to use its space (#1147)

When replacing a file container, we increase the `diskSpace`
by the file container's size. This doesn't affect the hidden volume
space logic, as in that case we use `MaxVolumeSize` when
`MaxVolumeSizeValid` is true instead of `AvailableDiskSpace`.
This commit is contained in:
Jertzukka 2023-07-05 13:00:37 +03:00 committed by GitHub
parent aa49278673
commit 232d3290b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,12 @@ namespace VeraCrypt
}
else
{
if (!volumePath.IsDevice())
{
wxULongLong containerSizeUnsigned = wxFileName (wstring (volumePath)).GetSize();
if (containerSizeUnsigned != wxInvalidSize)
diskSpace += static_cast<wxLongLong_t>(containerSizeUnsigned.GetValue());
}
AvailableDiskSpace = (uint64) diskSpace.GetValue ();
}