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:
Ondrej Kozina
2023-10-26 16:56:30 +02:00
parent fea8b82e8d
commit 7d17b09d41
2 changed files with 10 additions and 2 deletions

View File

@@ -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);