mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 02:19:04 +00:00
Fix deprecation warning on -iL by not coercing it to -i, the actual deprecated option
This commit is contained in:
14
nmap.cc
14
nmap.cc
@@ -599,7 +599,7 @@ void parse_options(int argc, char **argv) {
|
||||
{"oS", required_argument, 0, 0},
|
||||
{"oH", required_argument, 0, 0},
|
||||
{"oX", required_argument, 0, 0},
|
||||
{"iL", required_argument, 0, 'i'},
|
||||
{"iL", required_argument, 0, 0},
|
||||
{"iR", required_argument, 0, 0},
|
||||
{"sI", required_argument, 0, 0},
|
||||
{"source_port", required_argument, 0, 'g'},
|
||||
@@ -942,6 +942,18 @@ void parse_options(int argc, char **argv) {
|
||||
exit(0);
|
||||
} else if (strcmp(long_options[option_index].name, "badsum") == 0) {
|
||||
o.badsum = 1;
|
||||
} else if (strcmp(long_options[option_index].name, "iL") == 0) {
|
||||
if (o.inputfd) {
|
||||
fatal("Only one input filename allowed");
|
||||
}
|
||||
if (!strcmp(optarg, "-")) {
|
||||
o.inputfd = stdin;
|
||||
} else {
|
||||
o.inputfd = fopen(optarg, "r");
|
||||
if (!o.inputfd) {
|
||||
fatal("Failed to open input file %s for reading", optarg);
|
||||
}
|
||||
}
|
||||
} else if (strcmp(long_options[option_index].name, "iR") == 0) {
|
||||
o.generate_random_ips = 1;
|
||||
o.max_ips_to_scan = strtoul(optarg, &endptr, 10);
|
||||
|
||||
Reference in New Issue
Block a user