chiark / gitweb /
systemctl: check the argument to -t for invalid values
[elogind.git] / src / systemctl / systemctl.c
index c89920bccbe7f7cbc0c9acfeb184018a63d9899b..a9681798dd55baef54e0ca1087c5fcfedd8180c3 100644 (file)
@@ -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;