Fix error message for LUKS2 only cryptsetup commands.

Some cryptsetup commands requires LUKS2 device, but message
"not a LUKS device" is printed. Just change it to LUKS2.

Fixes: #741
This commit is contained in:
Milan Broz
2022-05-21 21:29:15 +02:00
parent 97a22c27dd
commit 16c35d155a

View File

@@ -1688,7 +1688,7 @@ static int luksAddUnboundKey(void)
goto out;
if ((r = crypt_load(cd, CRYPT_LUKS2, NULL))) {
log_err(_("Device %s is not a valid LUKS device."),
log_err(_("Device %s is not a valid LUKS2 device."),
uuid_or_device_header(NULL));
goto out;
}
@@ -1922,7 +1922,7 @@ static int action_luksConvertKey(void)
goto out;
if ((r = crypt_load(cd, CRYPT_LUKS2, NULL))) {
log_err(_("Device %s is not a valid LUKS device."),
log_err(_("Device %s is not a valid LUKS2 device."),
uuid_or_device_header(NULL));
goto out;
}
@@ -2502,7 +2502,7 @@ static int action_luksConfig(void)
return r;
if ((r = crypt_load(cd, CRYPT_LUKS2, NULL))) {
log_err(_("Device %s is not a valid LUKS device."),
log_err(_("Device %s is not a valid LUKS2 device."),
uuid_or_device_header(NULL));
goto out;
}
@@ -2646,7 +2646,7 @@ static int action_token(void)
return r;
if ((r = crypt_load(cd, CRYPT_LUKS2, NULL))) {
log_err(_("Device %s is not a valid LUKS device."),
log_err(_("Device %s is not a valid LUKS2 device."),
uuid_or_device(ARG_STR(OPT_HEADER_ID) ?: action_argv[1]));
crypt_free(cd);
return r;