mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
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.
This commit is contained in:
parent
47d80904a1
commit
0b6b7c2004
Notes:
Zbigniew Jędrzejewski-Szmek
2014-02-27 23:27:35 -05:00
Backport: bugfix
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue