Instead of erroring, just use tostring to handle functions, userdata,
etc. This works for booleans and numbers, too, so no need for special
handling there.
Also switched from a string-concatenation model to a table-building one,
with a final concatenation. This could prevent catastrophic slowness
with representing large tables due to continuous reallocation of
strings.
Used this perl command:
$ # perl -pi -e 's/string\.len\((.*?)\)/#\1/g' *.lua
Also fixed one instance where the above command didn't correctly
translate the intended code (string.len(a .. b .. c)).
* Updated the way authentication works on smb -- it's significantly cleaner now
* smb-enum-shares.nse gives significantly better output now (it checks if shares are writable)
* Added a script that checks if smbv2 is enabled on a server
* Added smb-psexec, a script for executing commands on a remote Windows server. I also included some default scripts, a compiled .exe to run everything, and a ton of documentation (in the form of NSEDoc)
* Added 'override' parameters to some of the functions in smb.lua, which lets the programmer override any field in an outgoing SMB packet without modifying smb.lua.
* Lots of random code cleanups in the smb-* scripts/libraries
Often two (or more) scripts using the same library would
overwrite the globals each was using. This would result
in (at best) an error or (at worst) a deadlock.
The patch changes the global accesses to local.