Skip to content

Commit 4c5dd40

Browse files
committed
8308872: enhance logging and some exception in krb5/Config.java
Backport-of: 70670b4af617699782f892ae4cb5228ec655a2d0
1 parent 788d658 commit 4c5dd40

File tree

1 file changed

+15
-2
lines changed
  • src/java.security.jgss/share/classes/sun/security/krb5

1 file changed

+15
-2
lines changed

src/java.security.jgss/share/classes/sun/security/krb5/Config.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ private static Void readConfigFileLines(
672672
private List<String> loadConfigFile(final String fileName)
673673
throws IOException, KrbException {
674674

675+
if (DEBUG) {
676+
System.out.println("Loading config file from " + fileName);
677+
}
675678
List<String> result = new ArrayList<>();
676679
List<String> raw = new ArrayList<>();
677680
Set<Path> dupsCheck = new HashSet<>();
@@ -782,6 +785,9 @@ private Hashtable<String,Object> parseStanzaTable(List<String> v)
782785
throws KrbException {
783786
Hashtable<String,Object> current = stanzaTable;
784787
for (String line: v) {
788+
if (DEBUG) {
789+
System.out.println(line);
790+
}
785791
// There are only 3 kinds of lines
786792
// 1. a = b
787793
// 2. a = {
@@ -981,16 +987,22 @@ public int[] defaultEtype(String configName) throws KrbException {
981987
String default_enctypes;
982988
default_enctypes = get("libdefaults", configName);
983989
if (default_enctypes == null && !configName.equals("permitted_enctypes")) {
990+
if (DEBUG) {
991+
System.out.println("Getting permitted_enctypes from libdefaults");
992+
}
984993
default_enctypes = get("libdefaults", "permitted_enctypes");
985994
}
986995
int[] etype;
987996
if (default_enctypes == null) {
988997
if (DEBUG) {
989-
System.out.println("Using builtin default etypes for " +
998+
System.out.println("default_enctypes were null, using builtin default etypes for configuration " +
990999
configName);
9911000
}
9921001
etype = EType.getBuiltInDefaults();
9931002
} else {
1003+
if (DEBUG) {
1004+
System.out.println("default_enctypes:" + default_enctypes);
1005+
}
9941006
String delim = " ";
9951007
StringTokenizer st;
9961008
for (int j = 0; j < default_enctypes.length(); j++) {
@@ -1012,7 +1024,8 @@ public int[] defaultEtype(String configName) throws KrbException {
10121024
}
10131025
}
10141026
if (ls.isEmpty()) {
1015-
throw new KrbException("no supported default etypes for "
1027+
throw new KrbException("out of " + len +
1028+
" default etypes no supported etypes found for configuration "
10161029
+ configName);
10171030
} else {
10181031
etype = new int[ls.size()];

0 commit comments

Comments
 (0)