Nmap Development mailing list archives

Re: [NSE] Adding mkdir support


From: Patrik Karlsson <patrik () cqure net>
Date: Fri, 30 Mar 2012 00:10:01 +0200

On Fri, Mar 30, 2012 at 12:05 AM, Patrick Donnelly <batrick () batbytes com>wrote:

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.


Ok, hmm, that complicates things for me I guess.



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.


Sounds like a good idea. How much work would it involve do you think?
Is it a matter of simply copying the code over or does it require a lot
other changes?

//Patrik
-- 
Patrik Karlsson
http://www.cqure.net
http://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: