summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-06-06 16:56:19 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-10 17:07:32 +0200
commit6d97280899a766ad7b4a6b07cc803709a08b364b (patch)
treee4286e5012d88ad7dedaabf0330d21ab6809f908 /src/systemctl
parent0a9f8ed00c8f323d5bf24a9a11149a9342c0e1aa (diff)
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.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index c89920bccb..a9681798dd 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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;