Skip to content

Getting "replacing registered class" warning from bindata #290

@md5

Description

@md5

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions