Closed adfoster-r7 closed 3 years ago
Well I was going to test this but I'm having trouble getting Metasploit to start with Ruby 3.0.0 as installed from RVM. I had to remove pcaprub-0.13.0 because that "requires ruby version ~> 2.0", after which I got the stack trace referenced below.
I see the unit tests pass when run by the automation, but I can't seem to reproduce that either. For what it's worth, it looks like the same tests are failing on both master and this PR branch when run with Ruby 3.0.0, however, when I run the tests from both branches with Ruby 2.7.2, there are no errors. Is that expected at this time?
Do you have any more details that might help with testing this?
@smcintyre-r7 Did you try with Ruby 3.0.1 on this branch, rather than 3.0.0?
Apologies, I thought you meant in isolation you tried the ruby_smb tests with Ruby 3.0.0. If you want to test change fixes metasploit console to work you'll need:
rvm use 3.0.1
(At the time of writing I haven't modified the .ruby-version
to point to 3.0.1)bundle
cd $(bundle info --path pcaprub) && rake compile && cd -
Note ruby_smb doesn't work with 3.0.0, only 3.0.1 due to a bug in Ruby's hash implementation which causes a bug in the bindata library
Thanks alot, those steps did the trick. Using Ruby 3.0.1 this time I was able to reproduce the original issue without these changes as well as confirm that the changes fix it. I was also able to run the unit tests and confirm that they all pass.
I'll get this merged in shortly, thanks @adfoster-r7 !
Fixes a Ruby 3.0.1 issue for metasploit console when attempting to enumerate shares:
This code path was being exercised within the rspec test suite, however, they're wrapped in rspec 'expect(...).to receive(opts)` - so they were passing, when they shouldn't have been.
Article: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
I tested framework and ruby_smb together by updating the gemfile to point to my local directory and rerunning
bundle