Add error message when suspending wrong device.

In case user tries to suspend LUKS data device instead
of dm-crypt mapping.

See issue#622.
This commit is contained in:
Ondrej Kozina
2021-02-24 12:59:05 +01:00
committed by Milan Broz
parent 93382071a5
commit 969be38a7a

View File

@@ -2214,8 +2214,11 @@ static int action_luksSuspend(void)
int r;
r = crypt_init_by_name_and_header(&cd, action_argv[0], uuid_or_device(opt_header_device));
if (!r)
if (!r) {
r = crypt_suspend(cd, action_argv[0]);
if (r == -ENODEV)
log_err(_("%s is not active %s device name."), action_argv[0], "LUKS");
}
crypt_free(cd);
return r;