mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
systemctl: check the argument to -t for invalid values
Systemctl accepted anything as the argument for -t, and simply said '0 units found'. It is better to catch this user error early.
This commit is contained in:
parent
0a9f8ed00c
commit
6d97280899
@ -4650,6 +4650,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
|
||||
return 0;
|
||||
|
||||
case 't':
|
||||
if (unit_type_from_string(optarg) < 0) {
|
||||
log_error("Invalid unit type '%s'.", optarg);
|
||||
return -EINVAL;
|
||||
}
|
||||
arg_type = optarg;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user