summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Broz <gmazyland@gmail.com>2013-07-27 12:33:22 +0200
committerMilan Broz <gmazyland@gmail.com>2013-07-27 12:43:48 +0200
commitd67548adfe4b98dc3202646a4239abb9469b7891 (patch)
tree1196e24d45713838480a4e7f34d91868c9eb638c
parentcfeaaa02fc50f7cab28c91f78d0f2da809bc0be1 (diff)
downloadcryptsetup-d67548adfe4b98dc3202646a4239abb9469b7891.tar.gz
cryptsetup-d67548adfe4b98dc3202646a4239abb9469b7891.tar.bz2
cryptsetup-d67548adfe4b98dc3202646a4239abb9469b7891.zip
Fails if more device arguments are present for isLuks.
Fixes http://code.google.com/p/cryptsetup/issues/detail?id=165
-rw-r--r--src/cryptsetup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cryptsetup.c b/src/cryptsetup.c
index 4722abd..5c2b96a 100644
--- a/src/cryptsetup.c
+++ b/src/cryptsetup.c
@@ -1010,6 +1010,12 @@ static int action_isLuks(void)
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;
@@ -1500,7 +1506,7 @@ int main(int argc, const char **argv)
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 */