Nmap Development mailing list archives

Re: Persistent NSE registry


From: David Fifield <david () bamsoftware com>
Date: Tue, 18 Nov 2008 12:57:58 -0700

On Tue, Nov 18, 2008 at 01:08:13AM -0700, Patrick Donnelly wrote:
o What should happen if a script scan is aborted? Perhaps the Lua
State was left corrupt?

That is a concern. Really the only thing I want to persist across script
scans is the registry. Everything else can be reinitialized.

o These two lines:
    lua_settop(L, 0); // safety, is 0 anyway
    lua_rawgeti(L, LUA_REGISTRYINDEX, errfunc); // index 1
should be executed each time a script_scan is run. It is possible
something was left on the stack from previous runs.

I don't understand what the line
     lua_rawgeti(L, LUA_REGISTRYINDEX, errfunc); // index 1
does. It pushes error_function on the stack, but then what? It doesn't
seem to do anything with it. Is this maybe some old code that didn't get
updated or do I just not understand?

David Fifield

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


Current thread: