You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by co...@apache.org on 2017/07/21 15:03:35 UTC

[18/18] directory-kerby git commit: Fixing dead code warning

Fixing dead code warning


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

Branch: refs/heads/trunk
Commit: cc107ac19eaa401934a472dd69988ea572594f9c
Parents: 6bf7ddb
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Jul 21 16:03:02 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Jul 21 16:03:02 2017 +0100

----------------------------------------------------------------------
 .../apache/kerby/kerberos/kerb/gss/impl/GssUtil.java   | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/cc107ac1/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java b/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
index 6b55ea9..0ee6d2c 100644
--- a/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
+++ b/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
@@ -304,11 +304,16 @@ public class GssUtil {
     public static KrbClientBase getKrbClient() {
         KrbClientBase client;
         try {
-            File confSpecified = new File(getSystemProperty("java.security.krb5.conf"));
-            if (confSpecified != null) {
-                client = new KrbClientBase(confSpecified);
+            String systemProperty = getSystemProperty("java.security.krb5.conf");
+            if (systemProperty != null) {
+                File confSpecified = new File(systemProperty);
+                if (confSpecified.exists()) {
+                    client = new KrbClientBase(confSpecified);
+                } else {
+                    client = new KrbClientBase();   // get configure file from environment variable or default path
+                }
             } else {
-                client = new KrbClientBase();   // get configure file from environment variable or default path
+                client = new KrbClientBase();
             }
 
             return client;