mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 13:20:11 +01:00
Allow to specify --align-payload only for luksFormat.
This commit is contained in:
@@ -1443,6 +1443,7 @@ int main(int argc, const char **argv)
|
||||
if (opt_random && opt_urandom)
|
||||
usage(popt_context, EXIT_FAILURE, _("Only one of --use-[u]random options is allowed."),
|
||||
poptGetInvocationName(popt_context));
|
||||
|
||||
if ((opt_random || opt_urandom) && strcmp(aname, "luksFormat"))
|
||||
usage(popt_context, EXIT_FAILURE, _("Option --use-[u]random is allowed only for luksFormat."),
|
||||
poptGetInvocationName(popt_context));
|
||||
@@ -1451,6 +1452,10 @@ int main(int argc, const char **argv)
|
||||
usage(popt_context, EXIT_FAILURE, _("Option --uuid is allowed only for luksFormat and luksUUID."),
|
||||
poptGetInvocationName(popt_context));
|
||||
|
||||
if (opt_align_payload && strcmp(aname, "luksFormat"))
|
||||
usage(popt_context, EXIT_FAILURE, _("Option --align-payload is allowed only for luksFormat."),
|
||||
poptGetInvocationName(popt_context));
|
||||
|
||||
if (opt_skip && strcmp(aname, "create") && strcmp(aname, "loopaesOpen"))
|
||||
usage(popt_context, EXIT_FAILURE,
|
||||
_("Option --skip is supported only for create and loopaesOpen commands.\n"),
|
||||
|
||||
Reference in New Issue
Block a user