Nmap Development mailing list archives

Re: [PATCH] Allow comments in exclusion file


From: David Fifield <david () bamsoftware com>
Date: Mon, 28 Sep 2009 20:17:06 -0600

On Sat, Sep 26, 2009 at 02:48:53PM -0500, Tom Sellers wrote:
I finally had the time to sit down and address David's recommendations
about my patch [1] to add comments to the exclusion file.

The attached patch does the following:

- Permits the use the pound sign "#" to denote comments in both the
input and exclusion files.

- Updates refguide.xml to reflect the ability to use comments.

- Based on David's suggestion [2], reworks the code to read the
exclusion file so that it functions like the code reading the input
file.  The exclusion code formerly read a line at a time, it now reads
and processes a character at a time.

Thanks very much, Tom. And thanks for remembering the documentation. I
applied your patch, then moved the logic into a shared function that
could be used by both grab_next_host_spec and load_exclude.

My real problem with how load_exclude worked was not that it was reading
a line at a time, but that it was doing the exact same parsing twice,
once to get the number of entries and again to fill in an array. I'm
sure you noticed how you had to make the exact same changes in two
places in load_exclude. After applying your patch I rewrote load_exclude
to do the parsing only once, and split it into load_exclude_file and
load_exclude_string.

David Fifield

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: