1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

8 Commits

Author SHA1 Message Date
d33tah
e3d1c178e3 Add newlines at the EOF in conformance to Daniel's coding standards
proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
2014-06-18 10:18:58 +00:00
perdo
6e5b999c99 Add parts of LuaFileSystem to NSE (support for mkdir, rmdir, link). 2012-07-17 18:07:28 +00:00
batrick
000f6dc4d9 Lua 5.2 upgrade [1] for NSE.
[1] http://seclists.org/nmap-dev/2012/q2/34
2012-05-27 08:53:32 +00:00
david
a9a84873f9 Add a new cnse.fetchscript, which first checks for an absolute path,
then looks in the scripts subdirectory, then in the current directory.
cnse.fetchfile_absolute now checks for an absolute path, then calls
nmap_fetchfile if that fails (and no longer looks in scripts/). Use
cnse.fetchscript when accessing files that should be in the scripts
subdirectory.
2011-03-26 06:48:29 +00:00
djalal
24807128d2 Merge r17640:18062 from /nmap-exp/djalal/nmap, this is a port of the LuaFileSystem directory iterator in order to use Lua code to list scripts. 2010-06-12 21:41:09 +00:00
batrick
68bf664db6 [NSE] Applied change to remove the old nse_macros.h header file.
Here is a mostly exhaustive list of the changes:

o Removes the SCRIPT_ENGINE_* status defines and replaces the
  instances with regular boolean integer returns or changes the
  procedure to return void. The latter case is better generally because
  the caller ignores any status return (e.g. nmap.cc calling open_nse)
  and/or the procedure raises a fatal error when unsuccessful.

o Moves the SCRIPT_ENGINE_LUA_DIR and the like to the nse_main.h header file.

o Removes the use of the SCRIPT_ENGINE_TRY (there was only one left)
  and thus changes the call to l_dnet_open to a void function called
  directly by luaopen_nsock (in nse_nsock.cc) instead of luaopen_nmap
  (in nse_nmaplib.cc). I felt moving the function was also an
  appropriate (but somewhat unrelated to the intent of the patch) change
  as opening the dnet metatable is very related to opening up the
  nsock library. This confines errors in opening the nsock library, including
  opening the dnet metatable, to the call to luaopen_nsock.

o The FILES and DIRS defines are moved in to nse_fs.h where they are
  more appropriate and localalized.
2009-06-07 01:25:53 +00:00
batrick
07cfc5aee4 Corrected many #includes for header files (where they are included).
Moved the includes for Lua headers to the .cc files so they are
not needlessly, repeatedly included.

Similarly, moved some standard headers to the .cc files and reorganized
includes to be uniform for all nse_* source files.

Fixed whitespace (removed tabs).
2009-03-10 05:56:10 +00:00
batrick
d0bc640db8 Large recode of nse_init.cc
Now does most of it's work through Lua:

From Nmap-dev: "Many of the changes consist of changing how Nmap interfaces
with Lua that were sometimes awkward or inflexible. Most of the functions 
have been made to be callable directly by Lua which offers many technical
advantages: stack management is alleviated, errors are handled cleanly and
are more descriptive, and there is increased reusability."

Additionally:
   -- Moved all lua_State * symbols from "l" to "L". This is to maintain
      consistency with other Lua libraries (convention) and to make our macros portable.
   -- Moved file system manipulation over to nse_fs.cc (from nse_init.cc)
2008-05-31 02:39:27 +00:00