提交 68ec1ae5 编写于 作者: W weijun

8022931: Enhance Kerberos exceptions

Reviewed-by: xuelei, ahgross
上级 35277e68
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
package javax.security.auth.kerberos; package javax.security.auth.kerberos;
import java.io.File; import java.io.File;
import java.security.AccessControlException;
import java.util.Objects; import java.util.Objects;
import sun.security.krb5.EncryptionKey; import sun.security.krb5.EncryptionKey;
import sun.security.krb5.KerberosSecrets; import sun.security.krb5.KerberosSecrets;
...@@ -214,9 +215,22 @@ public final class KeyTab { ...@@ -214,9 +215,22 @@ public final class KeyTab {
return new KeyTab(princ, null, true); return new KeyTab(princ, null, true);
} }
//Takes a snapshot of the keytab content // Takes a snapshot of the keytab content. This method is called by
// JavaxSecurityAuthKerberosAccessImpl so no more private
sun.security.krb5.internal.ktab.KeyTab takeSnapshot() { sun.security.krb5.internal.ktab.KeyTab takeSnapshot() {
try {
return sun.security.krb5.internal.ktab.KeyTab.getInstance(file); return sun.security.krb5.internal.ktab.KeyTab.getInstance(file);
} catch (AccessControlException ace) {
if (file != null) {
// It's OK to show the name if caller specified it
throw ace;
} else {
AccessControlException ace2 = new AccessControlException(
"Access to default keytab denied (modified exception)");
ace2.setStackTrace(ace.getStackTrace());
throw ace2;
}
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册