mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Properly handle interrupt in cryptsetup-reencrypt and remove log.
Fixes #419.
This commit is contained in:
@@ -588,8 +588,9 @@ static int create_new_header(struct reenc_ctx *rc, struct crypt_device *cd_old,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((r = crypt_format(cd_new, type, cipher, cipher_mode,
|
r = crypt_format(cd_new, type, cipher, cipher_mode, uuid, key, key_size, params);
|
||||||
uuid, key, key_size, params)))
|
check_signal(&r);
|
||||||
|
if (r < 0)
|
||||||
goto out;
|
goto out;
|
||||||
log_verbose(_("New LUKS header for device %s created."), rc->device);
|
log_verbose(_("New LUKS header for device %s created."), rc->device);
|
||||||
|
|
||||||
@@ -598,6 +599,7 @@ static int create_new_header(struct reenc_ctx *rc, struct crypt_device *cd_old,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
r = create_new_keyslot(rc, i, cd_old, cd_new);
|
r = create_new_keyslot(rc, i, cd_old, cd_new);
|
||||||
|
check_signal(&r);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto out;
|
goto out;
|
||||||
tools_keyslot_msg(r, CREATED);
|
tools_keyslot_msg(r, CREATED);
|
||||||
@@ -835,11 +837,13 @@ static int backup_fake_header(struct reenc_ctx *rc)
|
|||||||
|
|
||||||
r = crypt_format(cd_new, CRYPT_LUKS1, "cipher_null", "ecb",
|
r = crypt_format(cd_new, CRYPT_LUKS1, "cipher_null", "ecb",
|
||||||
NO_UUID, NULL, opt_key_size / 8, ¶ms);
|
NO_UUID, NULL, opt_key_size / 8, ¶ms);
|
||||||
|
check_signal(&r);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
r = crypt_keyslot_add_by_volume_key(cd_new, rc->keyslot, NULL, 0,
|
r = crypt_keyslot_add_by_volume_key(cd_new, rc->keyslot, NULL, 0,
|
||||||
rc->p[rc->keyslot].password, rc->p[rc->keyslot].passwordLen);
|
rc->p[rc->keyslot].password, rc->p[rc->keyslot].passwordLen);
|
||||||
|
check_signal(&r);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@@ -1535,6 +1539,8 @@ static int run_reencrypt(const char *device)
|
|||||||
.stained = 1
|
.stained = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
set_int_handler(0);
|
||||||
|
|
||||||
if (initialize_context(&rc, device))
|
if (initialize_context(&rc, device))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@@ -1654,8 +1660,6 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
crypt_set_log_callback(NULL, tool_log, NULL);
|
crypt_set_log_callback(NULL, tool_log, NULL);
|
||||||
|
|
||||||
set_int_block(1);
|
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
|||||||
Reference in New Issue
Block a user