Skip to content

Conversation

@wangweij
Copy link
Contributor

@wangweij wangweij commented Mar 11, 2024

Change Krb5LoginModule debugging to use sun.security.util.Debug.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8327830 to be approved

Issues

  • JDK-8327818: Implement Kerberos debug with sun.security.util.Debug (Enhancement - P4)
  • JDK-8327830: Implement Kerberos debug with sun.security.util.Debug (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18199/head:pull/18199
$ git checkout pull/18199

Update a local copy of the PR:
$ git checkout pull/18199
$ git pull https://git.openjdk.org/jdk.git pull/18199/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18199

View PR using the GUI difftool:
$ git pr show -t 18199

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18199.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 11, 2024

👋 Welcome back weijun! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels Mar 11, 2024
@openjdk
Copy link

openjdk bot commented Mar 11, 2024

@wangweij The following label will be automatically applied to this pull request:

  • security

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.

@openjdk openjdk bot added the security security-dev@openjdk.org label Mar 11, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 11, 2024

@openjdk
Copy link

openjdk bot commented Mar 13, 2024

@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:

8327818: Implement Kerberos debug with sun.security.util.Debug

Reviewed-by: coffeys, ssahoo

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 136 new commits pushed to the master branch:

  • c342188: 8328074: Add jcheck whitespace checking for assembly files
  • 3c70f26: 8328112: Remove CardTable::_guard_region
  • 48717d6: 8326333: jshell completion on arrays is incomplete
  • ece4124: 8328247: Remove redundant dir for tests converted from applet to main
  • d32ce65: 8327651: Rename DictionaryEntry members related to protection domain
  • 0719419: 8328236: module_entry in CDS map file has stale value
  • 0204aac: 8328115: Convert java/awt/font/TextLayout/TestJustification.html applet test to main
  • 9bc1b06: 8328242: Add a log area to the PassFailJFrame
  • 65a84c2: 8328006: refactor large anonymous inner class in HtmlDocletWriter
  • 044f4ed: 8326979: (jdeps) improve the error message for FindException caused by InvalidModuleDescriptorException
  • ... and 126 more: https://git.openjdk.org/jdk/compare/a6dc4bc2b83c7240e573ac43f9b7a10191c58ed3...master

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 master branch, type /integrate in a new comment.

@wangweij
Copy link
Contributor Author

wangweij commented Mar 14, 2024

A new commit is pushed to cover all other debug outpus in JGSS/krb5. Most of the changes are simply one of:

  1. if (DEBUG)/ to if (DEBUG != null)
  2. System.out.println to DEBUG.println.
  3. e.printStackTrace(System.out) to e.printStackTrace(DEBUG.getPrintStream())

There is no more DEBUG = Krb5.DEBUG assignments. Always use import static Krb5.DEBUG.

Copy link
Contributor

@coffeys coffeys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Few minor comments made.

the new Debug.of method will need to implement some logic from the decorator debug PR at #18084 -- depending on integration order, we can tackle that as needed.

* Usually, this method is used by other individual era-specific debug
* settings. For example,
* {@snippet lang=java:
* Map<String,String> settings = loadLoginSettings();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit - needs a space : Map<String, String>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add one.

* {@snippet lang=java:
* Map<String,String> settings = loadLoginSettings();
* String property = settings.get("login");
* Debug debug = Debug.of("login", setting);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to use the property variable name here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes.

* @param property debug setting for this option
* @return a new Debug object if the property is true
*/
public static Debug of(String option, String property) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the property name is a bit confusing here IMO. Most use cases will be string corresponding to a boolean (or null) - Would a boolean paramater make more sense ? Otherwise. I'd suggest renaming variable to something like debugEnabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that it will contain more options like true+timestamp later. By that time, we only need to update the Debug class to add this feature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Seems reasonable then.

I can see how folding these krb5 debug options in under the java.security.debug property will make debugging easier for everyone. Hopefully, something that can be done in the near future in a follow on patch.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Mar 16, 2024
*/
import com.sun.security.auth.module.Krb5LoginModule;
import jdk.test.lib.process.ProcessTools;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional line can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntelliJ IDEA suggested the format. The other imports (non Java SE) and normal imports (Java SE) are separated.

@wangweij
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 18, 2024

Going to push as commit 569b05a.
Since your change was applied there have been 143 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 18, 2024
@openjdk openjdk bot closed this Mar 18, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 18, 2024
@openjdk
Copy link

openjdk bot commented Mar 18, 2024

@wangweij Pushed as commit 569b05a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@wangweij wangweij deleted the 8327818 branch March 18, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated security security-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

4 participants