directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: NPE fix if no keytab is found and we have no principal name
Date Thu, 27 Jul 2017 09:07:19 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk db14ad6b2 -> b5033d994


NPE fix if no keytab is found and we have no principal name


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/b5033d99
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/b5033d99
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/b5033d99

Branch: refs/heads/trunk
Commit: b5033d9941b9796dd9b4f8ea5fc600577c4358cd
Parents: db14ad6
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Jul 27 10:07:03 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Jul 27 10:07:03 2017 +0100

----------------------------------------------------------------------
 .../apache/kerby/kerberos/kerb/gss/impl/GssAcceptCred.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/b5033d99/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssAcceptCred.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssAcceptCred.java
b/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssAcceptCred.java
index 120f9de..e33a4f3 100644
--- a/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssAcceptCred.java
+++ b/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssAcceptCred.java
@@ -46,8 +46,11 @@ public final class GssAcceptCred extends GssCredElement {
         }
 
         if (keyTab == null) {
-            throw new GSSException(GSSException.NO_CRED, -1,
-                    "Failed to find any Kerberos credential for " + name.getPrincipalName().getName());
+            String error = "Failed to find any Kerberos credential";
+            if (name != null) {
+                error +=  " for " + name.getPrincipalName().getName();
+            }
+            throw new GSSException(GSSException.NO_CRED, -1, error);
         }
 
         if (name == null) {


Mime
View raw message