-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate rex/logging into Core from Msf namespace #32
Migrate rex/logging into Core from Msf namespace #32
Conversation
Using Rex' various gems without Msf will result in errors when the logging subsystem is undefined (as that remained in Msf during the great Rex excision). This manifests in rex-socket as noted by @zeroSteiner in rapid7/rex-socket#38. Address the dependency problem by moving rex/logging into this gem which is already required by rex-socket and other descendants. Testing: None - this is a quick-n-dirty subdirectory move. If this works, someone with real git skill should migrate the relevant history of the code; as losing that stuff results in people not knowing whom to ask when the time comes to fix some deeply-bored bug.
I'm guessing this is an issue other gems as well? i.e. this isn't a viable fix in isolation?
|
Socket needs Core, so i think that if we can make Core happy by moving this in here, Socket should "become" happy as well. |
ping @adfoster-r7 - any blockers on this one? I cant rip these files from the Framework side until we have this PR merged 😄 |
No blockers; But since this will auto release as a gem bump on merge - it'd be good to have a the metasploit-framework PR prepped waiting to go so we can ship both one after the other 👀 |
Using Rex' various gems without Msf will result in errors when the logging subsystem is undefined (as that remained in Msf during the great Rex excision). This manifests in rex-socket as noted by @zeroSteiner in rapid7/rex-socket#38. Address the dependency problem by moving rex/logging into rex-core which is already required by rex-socket and other descendants. Notes: This PR is staged to allow github.com/rapid7/rex-core/pull/32 to be merged without creating a (seemingly harmless) redundancy.
@adfoster-r7 - Msf side staged, should be good to roll. Requesting manual validation post-merge as my environment deviates significantly from upstream's such that "what works here may not work for everyone." |
b95be3ed103c8 removed the internal require statements from logging in favor of Zeitwerk autoloading. Restore the requires removed at the time into rex-core to permit proper loading of the namespace.
Is there anyone around who knows how to move or clone the git history for these files from the MSF repo into this one? We want to preserve those histories as much as possible so subsequent generations can hunt down and yell at/beg for help from the original authors 😄 |
Good idea 👍 Should be able to look into this after 6.3 is released - unless someone gets nerds sniped on it sooner 😄 |
@adfoster-r7 This looks good to me, can you clarify if there is anything you would need from my side in order to get this landed? I think you wanted to make sure there was the corresponding Metasploit Framework PR and that seems to be up at the moment. |
@gwillcox-r7 The latest was this comment: rapid7/metasploit-framework#17506 (comment) I'm not super opinionated on preserving the history |
This PR won't work in its current form, attempting to log raises an error:
It turns out that msf console is mutating the global Kernel to include the rex logging constants:
Which we can see here: So this PR would need to be modified to work outside of the context of msfconsole still; Taking a step back though - including a gem probably shouldn't globally define methods such as |
Will mark this as attic'd for now - to help keep the PR queue tidy; it looks like there's more work required in other places to actually wire this up correctly (context) - regardless of preserving Git history 👍 Just for a paper trail: Cross-referencing the other test PR rapid7/metasploit-framework#17506 (comment) which I think had more of the missing pieces than this PR |
Using Rex' various gems without Msf will result in errors when the logging subsystem is undefined (as that remained in Msf during the great Rex excision). This manifests in rex-socket as noted by @zeroSteiner in rapid7/rex-socket#38.
Address the dependency problem by moving rex/logging into this gem which is already required by rex-socket and other descendants.
Testing:
None - this is a quick-n-dirty subdirectory move. If this works, someone with real git skill should migrate the relevant historyof the code; as losing that stuff results in people not knowing whom to ask when the time comes to fix some deeply-bored bug.