diff options
author | mlarkin <mlarkin@openbsd.org> | 2019-08-23 07:55:20 +0000 |
---|---|---|
committer | mlarkin <mlarkin@openbsd.org> | 2019-08-23 07:55:20 +0000 |
commit | f460dd9fe068d238e47877a9e105e1f80374ee9b (patch) | |
tree | ad9342c860756db666c612b366361a990c0c8397 /usr.sbin/vmctl | |
parent | res_hnok() is too lenient wrt to acceptable domain name in mail addresses. (diff) | |
download | wireguard-openbsd-f460dd9fe068d238e47877a9e105e1f80374ee9b.tar.xz wireguard-openbsd-f460dd9fe068d238e47877a9e105e1f80374ee9b.zip |
vmctl(8): fix wrong output when using 'vmctl stop'
Fix a wrong output when using 'vmctl stop' without any further arguments.
Patch from Caspar Schutijser, thanks!
ok deraadt
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r-- | usr.sbin/vmctl/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c index 02086d08611..3eb89c9fe96 100644 --- a/usr.sbin/vmctl/main.c +++ b/usr.sbin/vmctl/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.57 2019/07/05 22:22:40 jmc Exp $ */ +/* $OpenBSD: main.c,v 1.58 2019/08/23 07:55:20 mlarkin Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -945,7 +945,10 @@ ctl_stop(struct parse_result *res, int argc, char *argv[]) argc -= optind; argv += optind; - if (argc > 1) + if (argc == 0) { + if (res->action != CMD_STOPALL) + ctl_usage(res->ctl); + } else if (argc > 1) ctl_usage(res->ctl); else if (argc == 1) ret = parse_vmid(res, argv[0], 0); |