diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-02-26 23:01:43 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-02-27 00:43:24 -0500 |
commit | 0b6b7c2004317da48e5bbd3078c5662d8f0061b6 (patch) | |
tree | ec0d2b840aa42cdf498703171fb83432d3bb93d0 /src/journal/journalctl.c | |
parent | 47d80904a1f72d559962cc5ad32fffd46672a34a (diff) |
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.
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index a328ba11b0..0619b256b9 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; } |