From: Zbigniew Jędrzejewski-Szmek Date: Thu, 27 Feb 2014 04:01:43 +0000 (-0500) Subject: journalctl: refuse extra arguments with --verify and similar X-Git-Tag: v211~190 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=0b6b7c2004317da48e5bbd3078c5662d8f0061b6 journalctl: refuse extra arguments with --verify and similar Positional arguments only make sense with the default action. For other actions, complain instead of ignoring them silently. --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index a328ba11b..0619b256b 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -658,6 +658,11 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; } + if (arg_action != ACTION_SHOW && optind < argc) { + log_error("Extraneous arguments starting with '%s'", argv[optind]); + return -EINVAL; + } + return 1; }