Nmap Development mailing list archives

Re: NSE argument table syntax


From: Joao Correa <joao () livewire com br>
Date: Sat, 4 Jul 2009 10:39:23 -0300

Hello guys,

Here follows the patch fixing whois.nse and dns-zone-transfer.nse to
enable the use of the new arguments table syntax.

Thanks.

On Tue, Jun 23, 2009 at 4:40 AM, Joao Correa<joao () livewire com br> wrote:
On Tue, Jun 23, 2009 at 1:12 AM, David Fifield<david () bamsoftware com> wrote:
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.

Thanks for clarifying David. I was confused about this point. Anyway,
the compatibility was kept and the scripts are now accepting both
syntaxes.

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


Thanks,
Joao Correa

Attachment: dnszonetransfer-argtable.diff
Description:

Attachment: whois-argtable.diff
Description:


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

Current thread: