Fix logic error for SecuredLocked EraseMethod
The handling for the SecuredLocked EraseMethod is missing a '!'
operator. We want to lock the LUKS volume if it is NOT already locked.
Tested:
Loaded eStoraged on a machine and exercised the SecuredLocked code path
to confirm the expected behavior, i.e. lock if it's not already lock.
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: Iac55e56092cbef45e6212e1fa3b7a60ef8e2a60f
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index ef3bd63..5da6763 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -205,7 +205,7 @@
}
case Volume::EraseMethod::SecuredLocked:
{
- if (isLocked())
+ if (!isLocked())
{
lock();
}