Nmap Development mailing list archives

Nmap fails to compile without SSL support


From: Patrik Karlsson <patrik () cqure net>
Date: Sun, 26 Sep 2010 11:09:35 +0200

Hi,

Nmap fails to compile on one of my systems that lacks the proper SSL headers.
This is the error I'm seeing:

make[1]: Entering directory `/home/paka/nmap'
g++ -c -I./liblua -I./libdnet-stripped/include -I./libpcre  -I./libpcap -I./nbase -I./nsock/include -DHAVE_CONFIG_H 
-DNMAP_NAME=\"Nmap\" -DNMAP_URL=\"http://nmap.org\"; -DNMAP_PLATFORM=\"i686-pc-linux-gnu\" 
-DNMAPDATADIR=\"/usr/local/share/nmap\" -D_FORTIFY_SOURCE=2 -g -O2 -Wall -fno-strict-aliasing   nse_nsock.cc -o 
nse_nsock.o
nse_nsock.cc: In function ‘int get_ssl_certificate(lua_State*)’:
nse_nsock.cc:726: error: cannot convert ‘const char*’ to ‘lua_State*’ for argument ‘1’ to ‘int luaL_error(lua_State*, 
const char*, ...)’
make[1]: *** [nse_nsock.o] Error 1
make[1]: Leaving directory `/home/paka/nmap'

The attached patch solves this by adding the missing first L parameter to the function luaL_error.
After this first change I got this next error:

g++ -Wl,-E  -Lnbase -Lnsock/src/   -o nmap main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o 
osscan2.o output.o payload.o scan_engine.o timing.o charpool.o services.o protocols.o nmap_rpc.o portlist.o NmapOps.o 
TargetGroup.o Target.o FingerPrintResults.o service_scan.o NmapOutputTable.o MACLookup.o nmap_tty.o nmap_dns.o  
traceroute.o portreasons.o xml.o nse_main.o nse_utility.o nse_nsock.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o 
nse_pcrelib.o nse_binlib.o nse_bit.o  -lnbase -lnsock libpcre/libpcre.a libpcap/libpcap.a  libnetutil/libnetutil.a 
./libdnet-stripped/src/.libs/libdnet.a ./liblua/liblua.a -ldl 
nse_nsock.o:(.rodata+0x6c): undefined reference to `l_get_ssl_certificate(lua_State*)'

The patch solves this by renaming the get_ssl_certificate function to l_get_ssl_certificate.
Could someone double check that this patch is correct and if so commit it?

Regards,
//Patrik

Attachment: nse_nsock-lualerror.patch
Description:



--
Patrik Karlsson
http://www.cqure.net
http://www.twitter.com/nevdull77





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

Current thread: