Handle discrepancy of process launching on Windows between different versions of Java #726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a test failure when running acceptance tests with Java 8 on Windows.
At some point in the past, it seems that OpenJDK decided to change the behaviour of
ProcessBuilder
on Windows, to partially-but-not-entirely start doing some argv-like escaping when converting to a Windows command line.Seems like it's just better for us to avoid letting Java do any smarts, and just create a command line string that is passed straight to the
CreateProcess
API, which we know has been consistent since the dawn of time.Verification
On both older (Java 8? 11?) and newer (tested on Java 16):
java/meterpreter/reverse_tcp
), and run it on Windowsext_server_stdapi.jar is being used
loadpath test/modules/
use post/test/cmd_exec
run
with the captured session