mirror of
https://github.com/nmap/nmap.git
synced 2026-02-06 21:46:34 +00:00
Allow --exclude and --excludefile together.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o The --exclude and --excludefile options can be used together now. [David]
|
||||
|
||||
o [NSE] Added the script http-apache-negotiation that detects if the Apache
|
||||
module mod_negotiate is enabled. [Hani Benhabiles]
|
||||
|
||||
|
||||
3
nmap.cc
3
nmap.cc
@@ -1482,8 +1482,6 @@ void apply_delayed_options() {
|
||||
o.setSourceSockAddr(&tmpsock, sizeof(tmpsock));
|
||||
}
|
||||
|
||||
if (delayed_options.exclude_spec && delayed_options.exclude_file)
|
||||
fatal("--excludefile and --exclude options are mutually exclusive.");
|
||||
if(delayed_options.exclude_file) {
|
||||
o.excludefd = fopen(delayed_options.exclude_file, "r");
|
||||
if (!o.excludefd)
|
||||
@@ -1698,7 +1696,6 @@ int nmap_main(int argc, char *argv[]) {
|
||||
fclose(o.excludefd);
|
||||
}
|
||||
if (o.exclude_spec != NULL) {
|
||||
/* Simultaneous --excludefile and --exclude are not supported. */
|
||||
load_exclude_string(&exclude_group , o.exclude_spec);
|
||||
}
|
||||
|
||||
|
||||
16
targets.cc
16
targets.cc
@@ -92,6 +92,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
#include "nbase/nbase_addrset.h"
|
||||
#include "targets.h"
|
||||
#include "timing.h"
|
||||
#include "NmapOps.h"
|
||||
@@ -211,16 +212,13 @@ int load_exclude_string(addrset *excludelist, const char *s) {
|
||||
|
||||
|
||||
/* A debug routine to dump some information to stdout. Invoked if debugging is
|
||||
set to 3 or higher. I had to make significant changes from wam's code.
|
||||
Although wam displayed much more detail, alot of this is now hidden inside of
|
||||
the Target Group Object. Rather than writing a bunch of methods to return
|
||||
private attributes, which would only be used for debugging, I went for the
|
||||
method below. */
|
||||
set to 3 or higher. */
|
||||
int dumpExclude(addrset *exclude_group) {
|
||||
/* When we updated the exclude code to use addrset from nbase (originally
|
||||
from ncat) there was no simple available debugging function. Thus we are
|
||||
zeroing this and if it is needed look in nbase_addrset.c for the lower level
|
||||
debug function -Colin */
|
||||
const struct addrset_elem *elem;
|
||||
|
||||
for (elem = exclude_group->head; elem != NULL; elem = elem->next)
|
||||
addrset_elem_print(stdout, elem);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user