jdk/src/java.security.jgss/share/classes/sun/security/krb5/SCDynamicStoreConfig.java
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/SCDynamicStoreConfig.java Thu Jan 22 13:49:53 2015 -0800
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/SCDynamicStoreConfig.java Fri Jan 23 09:22:14 2015 +0800
@@ -113,15 +113,17 @@
@SuppressWarnings("unchecked")
private static Hashtable<String, Object> convertNativeConfig(
- Hashtable<String, Object> stanzaTable) {
+ Hashtable<String, Object> stanzaTable) throws IOException {
// convert SCDynamicStore realm structure to Java realm structure
Hashtable<String, ?> realms =
(Hashtable<String, ?>) stanzaTable.get("realms");
- if (realms != null) {
- stanzaTable.remove("realms");
- Hashtable<String, Object> realmsTable = convertRealmConfigs(realms);
- stanzaTable.put("realms", realmsTable);
+ if (realms == null || realms.isEmpty()) {
+ throw new IOException(
+ "SCDynamicStore contains an empty Kerberos setting");
}
+ stanzaTable.remove("realms");
+ Hashtable<String, Object> realmsTable = convertRealmConfigs(realms);
+ stanzaTable.put("realms", realmsTable);
WrapAllStringInVector(stanzaTable);
if (DEBUG) System.out.println("stanzaTable : " + stanzaTable);
return stanzaTable;