mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Merge branch '207-nslookup-takes-2-argvs-w-o-errors-uses-only-1st-and-last' into 'master'
Resolve "nslookup takes >2 argvs w/o errors, uses only 1st and last" Closes #207 See merge request isc-projects/bind9!1382
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
5157. [bug] Nslookup now errors out if there are extra command
|
||||||
|
line arguments. [GL #207]
|
||||||
|
|
||||||
--- 9.13.6 released ---
|
--- 9.13.6 released ---
|
||||||
|
|
||||||
5156. [doc] Extended and refined the section of the ARM describing
|
5156. [doc] Extended and refined the section of the ARM describing
|
||||||
|
@@ -879,6 +879,23 @@ get_next_command(void) {
|
|||||||
isc_mem_free(mctx, buf);
|
isc_mem_free(mctx, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ISC_PLATFORM_NORETURN_PRE static void
|
||||||
|
usage(void) ISC_PLATFORM_NORETURN_POST;
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage(void) {
|
||||||
|
fprintf(stderr, "Usage:\n");
|
||||||
|
fprintf(stderr,
|
||||||
|
" nslookup [-opt ...] # interactive mode using default server\n");
|
||||||
|
fprintf(stderr,
|
||||||
|
" nslookup [-opt ...] - server # interactive mode using 'server'\n");
|
||||||
|
fprintf(stderr,
|
||||||
|
" nslookup [-opt ...] host # just look up 'host' using default server\n");
|
||||||
|
fprintf(stderr,
|
||||||
|
" nslookup [-opt ...] host server # just look up 'host' using 'server'\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_args(int argc, char **argv) {
|
parse_args(int argc, char **argv) {
|
||||||
bool have_lookup = false;
|
bool have_lookup = false;
|
||||||
@@ -900,6 +917,9 @@ parse_args(int argc, char **argv) {
|
|||||||
in_use = true;
|
in_use = true;
|
||||||
addlookup(argv[0]);
|
addlookup(argv[0]);
|
||||||
} else {
|
} else {
|
||||||
|
if (argv[1] != NULL) {
|
||||||
|
usage();
|
||||||
|
}
|
||||||
set_nameserver(argv[0]);
|
set_nameserver(argv[0]);
|
||||||
check_ra = false;
|
check_ra = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user