directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [04/44] directory-kerby git commit: Fix DIRKRB-537.
Date Thu, 30 Jun 2016 08:53:51 GMT
Fix DIRKRB-537.


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

Branch: refs/heads/gssapi
Commit: f2e28623cc8e4abb7f7153a890a7ea07d56fa95b
Parents: fff2aa1
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Tue Apr 19 16:25:15 2016 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Tue Apr 19 16:25:15 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/kerberos/kerb/client/KrbHandler.java |  5 ++---
 .../org/apache/kerby/kerberos/kerb/server/KdcHandler.java | 10 +++++-----
 2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f2e28623/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
index c885001..1c6743f 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
@@ -135,9 +135,8 @@ public abstract class KrbHandler {
                 kdcRequest.resetPrequthContxt();
                 handleRequest(kdcRequest);
                 LOG.info("Retry with the new kdc request including pre-authentication.");
-            }
-            if (error.getErrorCode() == KrbErrorCode.KRB_AP_ERR_BAD_INTEGRITY) {
-                LOG.info(error.getEtext());
+            } else {
+                LOG.info(error.getErrorCode().getMessage());
                 throw new KrbException(error.getErrorCode(), error.getEtext());
             }
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f2e28623/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
index 02830bd..748f0bc 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
@@ -118,17 +118,17 @@ public class KdcHandler {
             if (e instanceof KdcRecoverableException) {
                 krbResponse = handleRecoverableException(
                         (KdcRecoverableException) e, kdcRequest);
-            } else if (e.getMessage().equals(KrbErrorCode.KRB_AP_ERR_BAD_INTEGRITY.getMessage()))
{
+            } else {
                 KrbError krbError = new KrbError();
                 krbError.setStime(KerberosTime.now());
-                krbError.setErrorCode(KrbErrorCode.KRB_AP_ERR_BAD_INTEGRITY);
+                krbError.setErrorCode(e.getKrbErrorCode());
                 krbError.setCname(kdcRequest.getClientEntry().getPrincipal());
                 krbError.setSname(kdcRequest.getServerPrincipal());
                 krbError.setRealm(kdcContext.getKdcRealm());
-                krbError.setEtext("PREAUTH_FAILED");
+                if (e.getKrbErrorCode().equals(KrbErrorCode.KRB_AP_ERR_BAD_INTEGRITY)) {
+                    krbError.setEtext("PREAUTH_FAILED");
+                }
                 krbResponse = krbError;
-            } else {
-                throw e;
             }
         }
 


Mime
View raw message