Skip to content

Commit 70670b4

Browse files
committed
8308872: enhance logging and some exception in krb5/Config.java
Reviewed-by: weijun
1 parent 024d9b1 commit 70670b4

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
@@ -671,6 +671,9 @@ private static Void readConfigFileLines(
671671
private List<String> loadConfigFile(final String fileName)
672672
throws IOException, KrbException {
673673

674+
if (DEBUG) {
675+
System.out.println("Loading config file from " + fileName);
676+
}
674677
List<String> result = new ArrayList<>();
675678
List<String> raw = new ArrayList<>();
676679
Set<Path> dupsCheck = new HashSet<>();
@@ -781,6 +784,9 @@ private Hashtable<String,Object> parseStanzaTable(List<String> v)
781784
throws KrbException {
782785
Hashtable<String,Object> current = stanzaTable;
783786
for (String line: v) {
787+
if (DEBUG) {
788+
System.out.println(line);
789+
}
784790
// There are only 3 kinds of lines
785791
// 1. a = b
786792
// 2. a = {
@@ -979,16 +985,22 @@ public int[] defaultEtype(String configName) throws KrbException {
979985
String default_enctypes;
980986
default_enctypes = get("libdefaults", configName);
981987
if (default_enctypes == null && !configName.equals("permitted_enctypes")) {
988+
if (DEBUG) {
989+
System.out.println("Getting permitted_enctypes from libdefaults");
990+
}
982991
default_enctypes = get("libdefaults", "permitted_enctypes");
983992
}
984993
int[] etype;
985994
if (default_enctypes == null) {
986995
if (DEBUG) {
987-
System.out.println("Using builtin default etypes for " +
996+
System.out.println("default_enctypes were null, using builtin default etypes for configuration " +
988997
configName);
989998
}
990999
etype = EType.getBuiltInDefaults();
9911000
} else {
1001+
if (DEBUG) {
1002+
System.out.println("default_enctypes:" + default_enctypes);
1003+
}
9921004
String delim = " ";
9931005
StringTokenizer st;
9941006
for (int j = 0; j < default_enctypes.length(); j++) {
@@ -1010,7 +1022,8 @@ public int[] defaultEtype(String configName) throws KrbException {
10101022
}
10111023
}
10121024
if (ls.isEmpty()) {
1013-
throw new KrbException("no supported default etypes for "
1025+
throw new KrbException("out of " + len +
1026+
" default etypes no supported etypes found for configuration "
10141027
+ configName);
10151028
} else {
10161029
etype = new int[ls.size()];

0 commit comments

Comments
 (0)