JDK-8278967 rmiregistry fails to start because SecurityManager is disabled #45
JDK-8278967 rmiregistry fails to start because SecurityManager is disabled #45
Conversation
👋 Welcome back smarks! A progress list of the required criteria for merging this PR into |
@stuart-marks The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Stuart,
I think specifying "allow" would be the behaviour preserving change here. That avoids any risk that enabling the SM earlier changes some behaviour during VM initialization.
Cheers,
David
This is strictly true. I did think about doing this. However, I don't think it makes much of a practical difference. It's always been fully supported to enable the security manager using properties, and the rmiregistry main hardly does anything before enabling the security manager. As long as we're going to the trouble of setting a property to allow the security manager, might as well enable it at the same time, I think. In addition, the warning messages emitted by enabling the security manager with the API are worse than those from the command line. Using the API gives this:
and using the property gives this:
Using the property gives a shorter warning and one that is less misleading (!) than the one from use of the API. (I mean, it's kind of ridiculous for the |
My concern is that having the SM installed during part of VM initialization could lead to different behaviour compared to installing the SM after that. This may be a small risk but it is a risk, and not something we are likely to observe in our own testing. If there is no way to hide those warning messages (@SuppressWarnings in the code?) then we have a serious flaw in our warning system. As you say these warnings are for the developer not the end user! |
/label add security |
@AlanBateman |
@AlanBateman |
As things stand, The warning that is emitted for both cases is expected. JEP 411 is very clear that it there is no mechanism to suppress it. We may need to add a release note to document that rmiregistry will emit a warning a startup, that will at least be something to point at in the event that anyone asks or reports an issue. |
I think there's little to worry about with custom configurations of the If Next headache is that The warnings policy is a separate issue being discussed elsewhere. |
In the same kind of PR (#53) for
And that PR uses |
Enabling the security manager using a property, versus setting the property to In this case some of the RMI registry tests set the property to I've also updated VersionCheck.java to filter out the security manager warning messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version looks okay, avoids having an attempt to set the SM in createRegistry always be skipped.
@stuart-marks This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 29 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build change looks good.
/integrate |
Going to push as commit 04ee921.
Your commit was automatically rebased without conflicts. |
@stuart-marks Pushed as commit 04ee921. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Enable the security manager in rmiregistry's launcher arguments.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk18 pull/45/head:pull/45
$ git checkout pull/45
Update a local copy of the PR:
$ git checkout pull/45
$ git pull https://git.openjdk.java.net/jdk18 pull/45/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 45
View PR using the GUI difftool:
$ git pr show -t 45
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk18/pull/45.diff