Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos

Nmap Development: NSE exceptions: false or nil?

NSE exceptions: false or nil?

From: David Fifield <david_at_bamsoftware.com>
Date: Thu, 1 Nov 2007 22:40:22 -0700

Are NSE exceptions supposed to return false or nil? At
http://insecure.org/nmap/nse/nse-api.html#nse-exceptions it says that
the first thing returned is a Boolean value. But trying to catch an
exception from connect fails, as the attached example script (test.nse)
shows. It produces this message:

        Initiating SCRIPT ENGINE at 22:26
        false Name or service not known
        SCRIPT ENGINE: In: nse_nmaplib.cc:474 Trying to finalize a non conforming function. Are you sure you return true on success followed by the remaining return values and nil on failure followed by an error string?
        QUITTING!

We see that connect returns (false, "Name or service not known"), but
this is "non conforming." Should NSE's internal functions be modified to
return nil instead of false, or should false be considered an exception
marker? Does the patch I attached do the right thing?

David Fifield

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

Received on Nov 01 2007
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]