Skip to content

Commit

Permalink
8308872: enhance logging and some exception in krb5/Config.java
Browse files Browse the repository at this point in the history
Reviewed-by: weijun
  • Loading branch information
MBaesken committed May 31, 2023
1 parent 024d9b1 commit 70670b4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/java.security.jgss/share/classes/sun/security/krb5/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ private static Void readConfigFileLines(
private List<String> loadConfigFile(final String fileName)
throws IOException, KrbException {

if (DEBUG) {
System.out.println("Loading config file from " + fileName);
}
List<String> result = new ArrayList<>();
List<String> raw = new ArrayList<>();
Set<Path> dupsCheck = new HashSet<>();
Expand Down Expand Up @@ -781,6 +784,9 @@ private Hashtable<String,Object> parseStanzaTable(List<String> v)
throws KrbException {
Hashtable<String,Object> current = stanzaTable;
for (String line: v) {
if (DEBUG) {
System.out.println(line);
}
// There are only 3 kinds of lines
// 1. a = b
// 2. a = {
Expand Down Expand Up @@ -979,16 +985,22 @@ public int[] defaultEtype(String configName) throws KrbException {
String default_enctypes;
default_enctypes = get("libdefaults", configName);
if (default_enctypes == null && !configName.equals("permitted_enctypes")) {
if (DEBUG) {
System.out.println("Getting permitted_enctypes from libdefaults");
}
default_enctypes = get("libdefaults", "permitted_enctypes");
}
int[] etype;
if (default_enctypes == null) {
if (DEBUG) {
System.out.println("Using builtin default etypes for " +
System.out.println("default_enctypes were null, using builtin default etypes for configuration " +
configName);
}
etype = EType.getBuiltInDefaults();
} else {
if (DEBUG) {
System.out.println("default_enctypes:" + default_enctypes);
}
String delim = " ";
StringTokenizer st;
for (int j = 0; j < default_enctypes.length(); j++) {
Expand All @@ -1010,7 +1022,8 @@ public int[] defaultEtype(String configName) throws KrbException {
}
}
if (ls.isEmpty()) {
throw new KrbException("no supported default etypes for "
throw new KrbException("out of " + len +
" default etypes no supported etypes found for configuration "
+ configName);
} else {
etype = new int[ls.size()];
Expand Down

3 comments on commit 70670b4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 70670b4 Jul 3, 2023

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch MBaesken-backport-70670b4a in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 70670b4a from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 31 May 2023 and was reviewed by Weijun Wang.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git MBaesken-backport-70670b4a:MBaesken-backport-70670b4a
$ git checkout MBaesken-backport-70670b4a
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git MBaesken-backport-70670b4a

Please sign in to comment.