projects
/
platform
/
upstream
/
cryptsetup.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fails if more device arguments are present for isLuks.
[platform/upstream/cryptsetup.git]
/
src
/
cryptsetup.c
diff --git
a/src/cryptsetup.c
b/src/cryptsetup.c
index
4722abd
..
5c2b96a
100644
(file)
--- a/
src/cryptsetup.c
+++ b/
src/cryptsetup.c
@@
-1010,6
+1010,12
@@
static int action_isLuks(void)
struct crypt_device *cd = NULL;
int r;
struct crypt_device *cd = NULL;
int r;
+ /* FIXME: argc > max should be checked for other operations as well */
+ if (action_argc > 1) {
+ log_err(_("Only one device argument for isLuks operation is supported.\n"));
+ return -ENODEV;
+ }
+
if ((r = crypt_init(&cd, action_argv[0])))
goto out;
if ((r = crypt_init(&cd, action_argv[0])))
goto out;
@@
-1500,7
+1506,7
@@
int main(int argc, const char **argv)
usage(popt_context, EXIT_FAILURE, _("Unknown action."),
poptGetInvocationName(popt_context));
usage(popt_context, EXIT_FAILURE, _("Unknown action."),
poptGetInvocationName(popt_context));
- if(action_argc < action->required_action_argc)
+ if
(action_argc < action->required_action_argc)
help_args(action, popt_context);
/* FIXME: rewrite this from scratch */
help_args(action, popt_context);
/* FIXME: rewrite this from scratch */