Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: Version display: included vs. system libraries
From: ambarisha b <b.ambarisha () gmail com>
Date: Wed, 23 Feb 2011 02:02:43 +0530

I have attached the patches.But how do we make it work on windows ? I
built nmap on windows and the included winpcap was used for the
build.Then I uninstalled the installed pcap and installed an older
version to check.It just worked fine.So how can I set and check macros
, if the libraries are being linked dynamically ? Is this because of
Windows registry ?

Cheers
Ambarisha


On Sat, Feb 19, 2011 at 11:32 PM, ambarisha b <b.ambarisha () gmail com> wrote:
Sure, I will get back once I am done.

Ambarisha

On Sat, Feb 19, 2011 at 2:42 AM, David Fifield <david () bamsoftware com> wrote:
On Thu, Feb 10, 2011 at 09:58:51AM +0530, ambarisha b wrote:
I like "nmap-" prefix because changing the library name indicates that
the library might have been edited for nmap as in libdnet.The other
two seem to indicate that we have just included the actual libraries
with nmap.

Okay, let's go with this. Option 2, the "nmap-" prefix. Would you like
to implement this, Ambarisha?

What you will need to do is find the places in configure.ac where the
included libraries are used. Then define a macro that we can test within
the program. For example, for libpcap, it will be something like this:

if test $have_libpcap != yes; then
 AC_CONFIG_SUBDIRS(libpcap)
 if test "${LIBPCAP_INC+set}" = "set"; then
   CPPFLAGS="$CPPFLAGS -I$LIBPCAP_INC"
 else
   CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/$libpcapdir"
 fi
 LIBPCAP_LIBS='$(LIBPCAPDIR)/libpcap.a'
 PCAP_DEPENDS='$(LIBPCAPDIR)/libpcap.a'
 PCAP_BUILD="pcap_build"
 PCAP_CLEAN="pcap_clean"
 PCAP_DIST_CLEAN="pcap_dist_clean"
 # This is the added line.
 AC_DEFINE(PCAP_INCLUDED)
else

You will then need to run the "autoconf" program to regenerate configure
from configure.ac. Also you will need to add a line for PCAP_INCLUDED to
nmap_config.h, following the format of the other lines in that file.

Then, in display_nmap_version, output the "nmap-" or not, depending on
whether PCAP_INCLUDED is defined.

The above instructions may not be completely correct but are probably
pretty close.

David Fifield


Attachment: configure.ac.patch
Description:

Attachment: nmap_config.h.in.patch
Description:

Attachment: nmap.cc.patch
Description:

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

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault