From f6cb8e4118d93a9ed79c9b68855869f1a908d38d Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Fri, 23 Feb 2018 13:47:29 +0100 Subject: [PATCH] Do not allow --persistent and --test-passphrase. --- src/cryptsetup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cryptsetup.c b/src/cryptsetup.c index 0a319536..ccacb3d4 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -2240,6 +2240,11 @@ int main(int argc, const char **argv) _("Option --persistent is allowed only for open operation.\n"), poptGetInvocationName(popt_context)); + if (opt_persistent && opt_test_passphrase) + usage(popt_context, EXIT_FAILURE, + _("Option --persistent is not allowed with --test-passphrase.\n"), + poptGetInvocationName(popt_context)); + if (opt_key_size && strcmp(aname, "luksFormat") && strcmp(aname, "open") &&