diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-04-28 15:55:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-04-28 15:55:56 +0000 |
commit | a68141c6083770af5e42a4e0651a4bf94ac03027 (patch) | |
tree | 800aeb337cfd9ce896404fb0af70e037e1b78b88 /usr.bin/dig | |
parent | a33f6c50aa625c37b886f828145d4593352b9e84 (diff) |
Rather than attempting to lookup the keyword "set" as a hostname,
issue a usage message. This matches both historical behaviour, and
the operation upon other keywords.
ok florian
Diffstat (limited to 'usr.bin/dig')
-rw-r--r-- | usr.bin/dig/nslookup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/dig/nslookup.c b/usr.bin/dig/nslookup.c index 570706f72d3..76b7abfe215 100644 --- a/usr.bin/dig/nslookup.c +++ b/usr.bin/dig/nslookup.c @@ -719,10 +719,12 @@ do_next_command(char *input) { if (ptr == NULL) return; arg = next_token(&input, " \t\r\n"); - if ((strcasecmp(ptr, "set") == 0) && - (arg != NULL)) - setoption(arg); - else if ((strcasecmp(ptr, "server") == 0) || + if (strcasecmp(ptr, "set") == 0) { + if (arg == NULL) + printf("Usage: set keyword=value, or set all\n"); + else + setoption(arg); + } else if ((strcasecmp(ptr, "server") == 0) || (strcasecmp(ptr, "lserver") == 0)) { isc_result_t res; |