*
* Copyright (C) 2004, Christophe Saout <christophe@saout.de>
* Copyright (C) 2004-2007, Clemens Fruhwirth <clemens@endorphin.org>
- * Copyright (C) 2009-2011, Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2009-2012, Red Hat, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
#include <fcntl.h>
#include <assert.h>
#include <limits.h>
-#include <libcryptsetup.h>
#include <popt.h>
#include "cryptsetup.h"
}
out:
crypt_free(cd);
+ if (r == -ENOTSUP)
+ r = 0;
return r;
}
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ crypt_fips_self_check(NULL);
+
popt_context = poptGetContext(PACKAGE, argc, argv, popt_options, 0);
poptSetOtherOptionHelp(popt_context,
- N_("[OPTION...] <action> <action-specific>]"));
+ N_("[OPTION...] <action> <action-specific>"));
while((r = poptGetNextOpt(popt_context)) > 0) {
unsigned long long ull_value;
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));
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"),