Nmap Development mailing list archives

Re: [NSE] Adding mkdir support


From: Patrick Donnelly <batrick () batbytes com>
Date: Thu, 29 Mar 2012 18:05:04 -0400

On Thu, Mar 29, 2012 at 5:59 PM, Patrik Karlsson <patrik () cqure net> wrote:


On Thu, Mar 29, 2012 at 11:34 PM, Patrick Donnelly <batrick () batbytes com>
wrote:

On Thu, Mar 29, 2012 at 5:00 PM, Patrik Karlsson <patrik () cqure net> wrote:
Hi all,

I'm working on implementing the http-mirror script and ran into some
trouble as there's no support for creating directories from within NSE.
I've tried to achieve this through the attached patch, and as my focus
is
mostly Lua, I would appreciate some comments concerning the
implementation.
I know that there is a luafilesystem module providing this and some
additional functionality, but at this point mkdir is really the only
thing
I need to complete the script.

In the past we have added parts of luafilesystem (directory iterator
comes to mind) which ended up being copied to nse_fs.cc. Maybe it's
time to just add lfs to NSE entirely?

--
- Patrick Donnelly


Ok, the nse_fs.cc does definitely look like a better place to add the code
:)
If we find we need another function or two from there, I vote for adding lfs
entirely.

The other issue is that nse_fs.cc is only available (currently) in the
private "cnse" library used by nse_main.lua. It isn't accessible by
scripts.

I think adding lfs to NSE is a good solution. We can move the NSE
specific stuff to the private cnse library in nse_main.cc or maybe in
nse_nmaplib.cc.

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

Current thread: