VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Unix
diff options
context:
space:
mode:
authoralt3r 3go <alt3r.3go@protonmail.com>2019-12-01 14:26:38 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-12-01 14:26:38 +0100
commit1fd212016e867850267eea44bc09c8df1aff8ca4 (patch)
tree2c3ec9ea44e0ddb78ed573a7a7b97e69e868234e /src/Core/Unix
parentb233e6776b6113475676d05cec6f5b8f1318d2f5 (diff)
downloadVeraCrypt-1fd212016e867850267eea44bc09c8df1aff8ca4.tar.gz
VeraCrypt-1fd212016e867850267eea44bc09c8df1aff8ca4.zip
UNIX: make sector size mismatch error more verbose (#552) (#561)
Signed-off-by: alt3r 3go <alt3r.3go@protonmail.com>
Diffstat (limited to 'src/Core/Unix')
-rw-r--r--src/Core/Unix/CoreUnix.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp
index 372c450f..423b5655 100644
--- a/src/Core/Unix/CoreUnix.cpp
+++ b/src/Core/Unix/CoreUnix.cpp
@@ -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