Nmap Development mailing list archives
Re: [NSE] Patch to get_args for deprecation
From: Kris Katterjohn <katterjohn () gmail com>
Date: Fri, 24 Sep 2010 00:12:25 -0500
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/23/2010 09:42 PM, David Fifield wrote:
On Thu, Sep 23, 2010 at 09:29:27PM -0500, Kris Katterjohn wrote:I think the warning message should be somehow configurable on a per-call or per-script basis. For example, using your patch I think I can update my scripts which have args like probeport and ipidseq.probeport; however, as discussed in previous threads I feel that neither is more preferred than the other and so I don't want a warning printed if a user (like me) uses probeport.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.
Cool, we agree now :) I wasn't sure if my ideas[1][2][3] made an impression on anybody (since the thread pretty abruptly ended). This looks like it will shape up to be a good solution, although the arg[] approach seemed nifty.
I agree that it would be nice to have some other way to mark deprecation than its position in the list. One idea I had is to use some reserved character that we don't use in script argument names, like stdnse.get_script_args({'smb.user', '!smbuser'}, {'smb.pass', '!smbpass'}, 'domain') But that's not really so important, and if it's easy to keep supporting the old names then there's no real reason to deprecate them.
If it's decided to keep deprecation support, I like your prefix ('!' or whatever) idea for it.
David Fifield
Cheers, Kris Katterjohn [1] http://seclists.org/nmap-dev/2010/q2/63 [2] http://seclists.org/nmap-dev/2010/q2/65 [3] http://seclists.org/nmap-dev/2010/q2/110 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMnDM4AAoJEEQxgFs5kUfu5NYP/ROkbaApd2uBIs423z7b1Z0E m7nYXcEtGUk2JJVUuULDabCD+L29CA6H6oHkt1GNaOXxMSHX+bGvQ6C+Vfwqv2aa M+v+Qs/2repCln7TzUUo/SWd0MpEOc+Qt3QM9g2nixe8lSPmkb/gcuG7g7XvXoWk KE34xdHSEYOGPrbXbPXTGIXE8XK7sIQ0YOU6wgN1bAiHZH+2T7MI+NtaKhjIWbP3 z1kar8JiIofUKASvEyX80Sm7jA3GwCpbgtuZ6ESUtGW7yvHHvVZ5VfcrmDIf9SfO x81Kwj72lfFPFFg8nUuVfHGjuF3PAJsf0J9zr1sa2Tzbb+bnb8gQltQ3CJsCPwy3 RqEwMqeMRkVSRU0bikkZeqWhhEMCtwxUArxPDqyr3n7BZo7514rflCxpd7fntl9c eti4HYjKWkISdwrjvmqibL4zdfLwbgHmCb9XlT3PdZAvltJd0d5S9JaIz5WRFb5f mj7lM4C2UuF4q14wQTygF7YhUruScOqJL2hzhj/6XVmw3nBzvmkYM+JzsfH2YoEk Um7jtyhW/cmt5nmWxmOK7s4qZiUk9VdF7/ANQrRQvKBjjaMLeQx3oXVgldlQTh1X kcZI5i9aAemuFIZGAhf+UsePsxHP5Qzvkn9xk0IvgmyxSQFnX2nma6OWJnwBCRHF Ui1Y6XoTFFoCIPzgeVgB =aJnG -----END PGP SIGNATURE----- _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- [NSE] Patch to get_args for deprecation Ron (Sep 23)
- Re: [NSE] Patch to get_args for deprecation Kris Katterjohn (Sep 23)
- Re: [NSE] Patch to get_args for deprecation David Fifield (Sep 23)
- Re: [NSE] Patch to get_args for deprecation Ron (Sep 23)
- Re: [NSE] Patch to get_args for deprecation David Fifield (Sep 23)
- Re: [NSE] Patch to get_args for deprecation Ron (Sep 24)
- Re: [NSE] Patch to get_args for deprecation David Fifield (Sep 24)
- Re: [NSE] Patch to get_args for deprecation Ron (Sep 25)
- Re: [NSE] Patch to get_args for deprecation David Fifield (Sep 23)
- Re: [NSE] Patch to get_args for deprecation Kris Katterjohn (Sep 23)
- Re: [NSE] Patch to get_args for deprecation Fyodor (Sep 24)
- Re: [NSE] Patch to get_args for deprecation Kris Katterjohn (Sep 23)