Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: NSE argument table syntax
From: David Fifield <david () bamsoftware com>
Date: Mon, 22 Jun 2009 22:12:49 -0600

On Mon, Jun 22, 2009 at 10:32:20PM -0300, Joao Correa wrote:
Thanks for the answer. I've discussed it a little with Patrick and we
also agreed that it is not a great deal.

I was just worried about making a function to keep it simpler for the
future scripts. Do we expect that the backwards compatibility still
works on these scripts to come? If so, it would be nice to have such
function.

I agree that the patch is not working, I've also found some other
situations where it won't fix the problem. Sorry for not having
updated it earlier.

There are 4 scripts that use table arguments and it is not hard to
make the manual checkings on them. The problem is just that it will be
a recurrent problem for the future, as mentioned.

I don't understand why it will be a future problem. If we're going to
make scripts take arguments like
        --script=scriptname.arg=val
then there's no reason to even support
        --script=scriptname={arg=val}
in new scripts.

When I was talking about backwards compatibility, I was thinking about
someone who perhaps has a shell script that runs a command using the old
script argument format. We don't want to break all those commands. But
in new scripts there's no previous version to be compatible with.

Also, there is one more problem. Using the new syntax requires
programmers to use nmap.registry.args['table.arg'] instead of
nmap.registry.args.table.arg. I don't know if everyone agrees, but I
think that it can make the code a little dirtier.

That's a valid point. I agree it doesn't look as good. I think people
usually store the script arguments in local variables, so it doesn't
affect that much code. I think it would be better if better if
programmers could use the second syntax. I think you are right that the
external user interface is the most important. If we can have both then
that's even better.

David Fifield

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


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault