-
Notifications
You must be signed in to change notification settings - Fork 81
Description
I'm looking at possibly using ruby_smb for a project and after adding it to my Gemfile and loading it up, I'm seeing a bunch of warnings like the following:
warning: replacing registered class RubySMB::SMB2::BitField::DirectoryAccessMask with RubySMB::SMB1::BitField::DirectoryAccessMask
warning: replacing registered class RubySMB::SMB2::BitField::FileAccessMask with RubySMB::SMB1::BitField::FileAccessMask
warning: replacing registered class RubySMB::SMB2::Packet::NegotiateRequest with RubySMB::SMB1::Packet::NegotiateRequest
warning: replacing registered class RubySMB::SMB1::DataBlock with RubySMB::SMB1::Packet::NegotiateRequest::DataBlock
warning: replacing registered class RubySMB::SMB2::Packet::NegotiateResponse with RubySMB::SMB1::Packet::NegotiateResponse
It repeats like that for 111 colliding class names.
Based on the discussion in dmendel/bindata#157, it seems like perhaps using their namespacing feature would remove these warnings. They even point to another rapid7 repo as an example of using the feature:
- https://github.com/rapid7/metasploit-framework/blob/master/lib/rex/proto/amqp/version_0_9_1/types.rb
- https://github.com/rapid7/metasploit-framework/blob/master/lib/rex/proto/amqp/version_0_9_1/frames/method_arguments.rb
I do see one use of search_prefix in this project, but it also seems that these class names are basically part of the public API since some of them are mentioned in README.md, so maybe they can't be namespaced to avoid these warnings without being a breaking change for users.
If the warnings can be safely ignored, it would be ideal if they were not shown every time I load up this gem (e.g. by ruby_smb wrapping the part of the code that triggers the warnings with Kernel.silence_warnings).