1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

UNIX: make sector size mismatch error more verbose (#552) (#561)

Signed-off-by: alt3r 3go <alt3r.3go@protonmail.com>
This commit is contained in:
alt3r 3go
2019-12-01 14:26:38 +01:00
committed by Mounir IDRASSI
parent b233e6776b
commit 1fd212016e
4 changed files with 8 additions and 2 deletions

View File

@@ -473,8 +473,10 @@ namespace VeraCrypt
if (options.Path->IsDevice())
{
if (volume->GetFile()->GetDeviceSectorSize() != volume->GetSectorSize())
throw ParameterIncorrect (SRC_POS);
const uint32 devSectorSize = volume->GetFile()->GetDeviceSectorSize();
const size_t volSectorSize = volume->GetSectorSize();
if (devSectorSize != volSectorSize)
throw DeviceSectorSizeMismatch (SRC_POS, StringConverter::ToWide(devSectorSize) + L" != " + StringConverter::ToWide(volSectorSize));
}
// Find a free mount point for FUSE service