< prev index next >

test/sun/security/krb5/config/DNS.java

Print this page
rev 10772 : imported patch 8077102-dns_lookup_realm-should-be-false-by-default

*** 21,36 **** * questions. */ // See dns.sh. import sun.security.krb5.Config; public class DNS { public static void main(String[] args) throws Exception { System.setProperty("java.security.krb5.conf", ! System.getProperty("test.src", ".") +"/nothing.conf"); Config config = Config.getInstance(); String kdcs = config.getKDCList("X"); if (!kdcs.equals("a.com.:88 b.com.:99") && !kdcs.equals("a.com. b.com.:99")) { throw new Exception("Strange KDC: [" + kdcs + "]"); }; --- 21,46 ---- * questions. */ // See dns.sh. import sun.security.krb5.Config; + import sun.security.krb5.KrbException; public class DNS { public static void main(String[] args) throws Exception { System.setProperty("java.security.krb5.conf", ! System.getProperty("test.src", ".") +"/no-such-file.conf"); Config config = Config.getInstance(); + try { + String r = config.getDefaultRealm(); + throw new Exception("What? There is a default realm " + r + "?"); + } catch (KrbException ke) { + ke.printStackTrace(); + if (ke.getCause() != null) { + throw new Exception("There should be no cause. Won't try DNS"); + } + } String kdcs = config.getKDCList("X"); if (!kdcs.equals("a.com.:88 b.com.:99") && !kdcs.equals("a.com. b.com.:99")) { throw new Exception("Strange KDC: [" + kdcs + "]"); };
< prev index next >