Nmap Development mailing list archives

Re: [NSE] Patch to get_args for deprecation


From: David Fifield <david () bamsoftware com>
Date: Thu, 23 Sep 2010 20:27:33 -0700

On Thu, Sep 23, 2010 at 09:57:00PM -0500, Ron wrote:
On Thu, 23 Sep 2010 19:42:34 -0700 David Fifield <david () bamsoftware com> wrote:
Yes, that's a great idea. I think the default behavior (for scripts)
should also be to automatically add the script prefix, so

stdnse.get_script_args("path")

in http-whatever.nse would accept either of the arguments "path" or
"http-whatever.path". This matches the convention that Kris uses in
his scripts. And then scripts would automatically support the naming
convention instead of manually doing it.

I can see one issue that may actually not be an issue. The smbbasic
argument (which turns on 'basic' authentication as opposed to
extended) is in smb.lua, but smbuser and smbpass are both defined in
smbauth.lua. It'd be best if those were all in the 'smb.' namespace,
even though the others are technically defined in smbauth.lua. 

This would only apply to scripts, not libraries. (I'm not sure if that's
technically easy to accomplish.) If a script wants only a fully
qualified name for whatever reason, get_script_args could be smart
enough to look for a dot and not add an extra qualification in that
case.

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


Current thread: