fix bad argument exception when using smb-ls script #588

wants to merge 1 commit into


None yet

7 participants


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.

@dallaswinger dallaswinger add / to match line 1068 that changed in Merge branch 'nse-lua53' 36c32da
sstelfox commented Nov 9, 2016

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 :)

awk9000 commented Nov 11, 2016

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 only expects integer value as second parameter.

cldrn commented Nov 21, 2016

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?

@nmap-bot nmap-bot closed this in 70e9d70 Nov 30, 2016
@suraj51k suraj51k added a commit to suraj51k/nmap that referenced this pull request Jan 31, 2017
@bonsaiviking @suraj51k bonsaiviking + suraj51k Avoid passing float to os.time. Fixes #588 0e71799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment