mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Print better warning if online reencrypt is called over LUKS1.
This commit is contained in:
@@ -3113,11 +3113,16 @@ static int action_reencrypt(void)
|
||||
if ((r = crypt_init_data_device(&cd, uuid_or_device(opt_header_device ?: action_argv[0]), action_argv[0])))
|
||||
return r;
|
||||
|
||||
if ((r = crypt_load(cd, CRYPT_LUKS2, NULL))) {
|
||||
if ((r = crypt_load(cd, CRYPT_LUKS, NULL))) {
|
||||
log_err(_("Device %s is not a valid LUKS device."),
|
||||
uuid_or_device(opt_header_device ?: action_argv[0]));
|
||||
goto out;
|
||||
}
|
||||
if (strcmp(crypt_get_type(cd), CRYPT_LUKS2)) {
|
||||
log_err(_("Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1."));
|
||||
r = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (crypt_persistent_flags_get(cd, CRYPT_FLAGS_REQUIREMENTS, &flags)) {
|
||||
|
||||
Reference in New Issue
Block a user