diff options
author | Jertzukka <Jertzukka@gmail.com> | 2023-07-05 13:00:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 19:00:37 +0900 |
commit | 232d3290b0e57f8f6ad42049c3c2954b5810ab97 (patch) | |
tree | 29c6be3749fdbcab2829069876e7514bc2e88936 /src/Main/Forms | |
parent | aa4927867326f293204b23fd6219781bf36cbaf5 (diff) | |
download | VeraCrypt-232d3290b0e57f8f6ad42049c3c2954b5810ab97.tar.gz VeraCrypt-232d3290b0e57f8f6ad42049c3c2954b5810ab97.zip |
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`.
Diffstat (limited to 'src/Main/Forms')
-rw-r--r-- | src/Main/Forms/VolumeSizeWizardPage.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Main/Forms/VolumeSizeWizardPage.cpp b/src/Main/Forms/VolumeSizeWizardPage.cpp index ce337620..83fdd40f 100644 --- a/src/Main/Forms/VolumeSizeWizardPage.cpp +++ b/src/Main/Forms/VolumeSizeWizardPage.cpp @@ -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 (); } |