提交 0a3e7520 编写于 作者: I igerasim

8149521: automatic discovery of LDAP servers with Kerberos authentication

Reviewed-by: vinnie
上级 02043973
...@@ -424,6 +424,9 @@ public class PrincipalName implements Cloneable { ...@@ -424,6 +424,9 @@ public class PrincipalName implements Cloneable {
} catch (UnknownHostException | SecurityException e) { } catch (UnknownHostException | SecurityException e) {
// not canonicalized or no permission to do so, use old // not canonicalized or no permission to do so, use old
} }
if (hostName.endsWith(".")) {
hostName = hostName.substring(0, hostName.length() - 1);
}
nameParts[1] = hostName.toLowerCase(Locale.ENGLISH); nameParts[1] = hostName.toLowerCase(Locale.ENGLISH);
} }
nameStrings = nameParts; nameStrings = nameParts;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
/* /*
* @test * @test
* @bug 6682516 * @bug 6682516 8149521
* @summary SPNEGO_HTTP_AUTH/WWW_KRB and SPNEGO_HTTP_AUTH/WWW_SPNEGO failed on all non-windows platforms * @summary SPNEGO_HTTP_AUTH/WWW_KRB and SPNEGO_HTTP_AUTH/WWW_SPNEGO failed on all non-windows platforms
* @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock -Djava.security.krb5.conf=krb5.conf Test * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock -Djava.security.krb5.conf=krb5.conf Test
*/ */
...@@ -43,9 +43,11 @@ public class Test implements NameServiceDescriptor { ...@@ -43,9 +43,11 @@ public class Test implements NameServiceDescriptor {
check("c1", "c1.this.domain"); check("c1", "c1.this.domain");
check("c1.this", "c1.this.domain"); check("c1.this", "c1.this.domain");
check("c1.this.domain", "c1.this.domain"); check("c1.this.domain", "c1.this.domain");
check("c1.this.domain.", "c1.this.domain");
// canonicalized name goes IP, reject // canonicalized name goes IP, reject
check("c2", "c2"); check("c2", "c2");
check("c2.", "c2");
// canonicalized name goes strange, reject // canonicalized name goes strange, reject
check("c3", "c3"); check("c3", "c3");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册