Systemctl accepted anything as the argument for -t, and simply said '0
units found'. It is better to catch this user error early.
---
src/systemctl/systemctl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2fbfd7e..cc0b999 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4482,6 +4482,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
return 0;
case 't':
+ if (unit_type_from_string(optarg) == -1) {
+ log_error("Invalid unit type '%s'", optarg);
+ return -EINVAL;
+ }
arg_type = optarg;
break;
--
1.7.10.2.667.gf1138e2
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel