1
0
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:
dmiller
2015-10-20 17:48:56 +00:00
parent 4c54ca6fdf
commit e39d3e4101

14
nmap.cc
View File

@@ -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);