After updating to nmap7.25BETA2 from nmap7.25BETA1 I started consistently encountering a bad date argument exception when trying to run the smb-ls script on a target
On line 1068 an additional / was added to the expression in commit "Merge branch 'nse-lua53'"
Adding a / to the expression on line 2808 to match line 1068 fixes the issue.
Alternatively, removing the newly added / to the expression on line 1068 should also fix it.
I do not know which solution is preferred/correct.
add / to match line 1068 that changed in Merge branch 'nse-lua53'
The difference is a single slash ('/') will do full division return a floating point number. A double slash ('//') will drop the decimal returning a whole integer.
Based on how it is being used I'm guessing the double slash, dropping the decimals values, is correct.
@sstelfox thank you for the clarification :)
Also tested this with latest stable update, smb-ls fails, downloaded Dallas's modified smb.lua and replaced, retested, everything works!
As stated by @sstelfox already Link tells that // will perform floor division, which is needed in this case since os.date() only expects integer value as second parameter.
I will look into this today, your solution seems correct. Thanks for all the details.
@cldrn bump, did you get a chance to look at this?
Avoid passing float to os.time. Fixes #588