cryptsetup: add close --cancel-deferred

Allows to remove a previously set deferred removal from the command
line.

[mbroz: ported to new CLI parsing]
This commit is contained in:
Luca Boccassi
2020-07-15 15:38:07 +01:00
committed by Milan Broz
parent 3062a9ba91
commit 53d3ca0062
4 changed files with 14 additions and 1 deletions

View File

@@ -617,6 +617,8 @@ static int action_close(void)
if (ARG_SET(OPT_DEFERRED_ID))
flags |= CRYPT_DEACTIVATE_DEFERRED;
if (ARG_SET(OPT_CANCEL_DEFERRED_ID))
flags |= CRYPT_DEACTIVATE_DEFERRED_CANCEL;
r = crypt_init_by_name(&cd, action_argv[0]);
if (r == 0)
@@ -3679,6 +3681,11 @@ int main(int argc, const char **argv)
_("Options --refresh and --test-passphrase are mutually exclusive."),
poptGetInvocationName(popt_context));
if (ARG_SET(OPT_CANCEL_DEFERRED_ID) && ARG_SET(OPT_DEFERRED_ID))
usage(popt_context, EXIT_FAILURE,
_("Options --cancel-deferred and --deferred cannot be used at the same time."),
poptGetInvocationName(popt_context));
/* open action specific check */
if (ARG_SET(OPT_SHARED_ID) && strcmp_or_null(device_type, "plain"))
usage(popt_context, EXIT_FAILURE,