-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8316964: Security tools should not call System.exit #15951
Conversation
👋 Welcome back weijun! A progress list of the required criteria for merging this PR into |
Webrevs
|
src/java.base/share/classes/sun/security/tools/keytool/Main.java
Outdated
Show resolved
Hide resolved
src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Klist.java
Outdated
Show resolved
Hide resolved
src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Ktab.java
Outdated
Show resolved
Hide resolved
src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java
Outdated
Show resolved
Hide resolved
src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Klist.java
Outdated
Show resolved
Hide resolved
src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Ktab.java
Show resolved
Hide resolved
src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java
Outdated
Show resolved
Hide resolved
src/java.security.jgss/windows/classes/sun/security/krb5/internal/tools/Klist.java
Outdated
Show resolved
Hide resolved
+ options.action); | ||
} | ||
} catch (Exception e) { | ||
String msg; | ||
if (e instanceof KrbException) { |
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.
Let's simplify with pattern matching variable
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.
+1. Rest looks good to me.
} | ||
|
||
private void run(String[] args, PrintStream out) throws Exception { | ||
public int run(String[] args, PrintStream out) throws Exception { |
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.
Is this run() method used outside of this class, and thus the scope change?
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 allows the tools to be called externally. These are still non-public APIs but at least with some --add-exports
it can be called elsewhere.
@wangweij 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 524 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 |
/integrate |
Going to push as commit 1ddf826.
Your commit was automatically rebased without conflicts. |
Remove most
System.exit()
calls in various security tools and only leave one in themain
method. This paves the way to convert them to JSR 199 tools.Note: before this change, the behavior of a successful
main()
method execution is not consistent. Sometimes the method returns silently, sometimes aSystem.exit(0)
is called somewhere. After this change, the method always returns silently. This makes sure that existing programs that calls themain
method directly will continue and does not exit the VM.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15951/head:pull/15951
$ git checkout pull/15951
Update a local copy of the PR:
$ git checkout pull/15951
$ git pull https://git.openjdk.org/jdk.git pull/15951/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15951
View PR using the GUI difftool:
$ git pr show -t 15951
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15951.diff
Webrev
Link to Webrev Comment