mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-12 19:30:04 +01:00
Do not fail format actions by interrupting device wipe.
otherwise luksFormat and (integrity) format actions return error when interrupted by user on purpose.
This commit is contained in:
@@ -1636,8 +1636,12 @@ int luksFormat(struct crypt_device **r_cd, char **r_password, size_t *r_password
|
||||
tools_keyslot_msg(r, CREATED);
|
||||
|
||||
if (ARG_SET(OPT_INTEGRITY_ID) && !ARG_SET(OPT_INTEGRITY_NO_WIPE_ID) &&
|
||||
strcmp_or_null(params2.integrity, "none"))
|
||||
strcmp_or_null(params2.integrity, "none")) {
|
||||
r = _wipe_data_device(cd);
|
||||
/* Interrupted wipe should not fail luksFormat action */
|
||||
if (r == -EINTR)
|
||||
r = 0;
|
||||
}
|
||||
out:
|
||||
crypt_safe_free(key);
|
||||
|
||||
|
||||
@@ -217,8 +217,12 @@ static int action_format(void)
|
||||
log_std(_("Formatted with tag size %u, internal integrity %s.\n"),
|
||||
params2.tag_size, params2.integrity);
|
||||
|
||||
if (!ARG_SET(OPT_NO_WIPE_ID))
|
||||
if (!ARG_SET(OPT_NO_WIPE_ID)) {
|
||||
r = _wipe_data_device(cd, integrity_key);
|
||||
/* Interrupted wipe should not fail format action */
|
||||
if (r == -EINTR)
|
||||
r = 0;
|
||||
}
|
||||
out:
|
||||
crypt_safe_free(integrity_key);
|
||||
crypt_safe_free(CONST_CAST(void*)params.journal_integrity_key);
|
||||
|
||||
Reference in New Issue
Block a user