directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [1/2] directory-kerby git commit: DIRKRB-455 Configuring kdc_host in client krb5.conf doesn't work
Date Sat, 14 Nov 2015 13:13:14 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 9f4c1fe0e -> cae0be35d


DIRKRB-455 Configuring kdc_host in client krb5.conf doesn't work


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

Branch: refs/heads/master
Commit: 5ffd0a280afd417539a2b474d0714a81db303b28
Parents: 3b5a446
Author: Kai Zheng <kai.zheng@intel.com>
Authored: Sat Nov 14 21:10:16 2015 +0800
Committer: Kai Zheng <kai.zheng@intel.com>
Committed: Sat Nov 14 21:10:16 2015 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/client/KrbConfig.java   |  2 +-
 .../kerberos/kerb/client/KrbConfigKey.java      |  2 +-
 .../kerberos/kerb/client/TestKrbConfigLoad.java |  2 +-
 .../kerb-client/src/test/resources/krb5.conf    | 41 ++++++++++----------
 4 files changed, 24 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5ffd0a28/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfig.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfig.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfig.java
index 2f88a91..4649e14 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfig.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfig.java
@@ -40,7 +40,7 @@ public class KrbConfig extends Conf {
      * @return The kdc host
      */
     public String getKdcHost() {
-        return getString(KrbConfigKey.KDC_HOST);
+        return KrbConfHelper.getStringUnderSection(this, KrbConfigKey.KDC_HOST);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5ffd0a28/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfigKey.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfigKey.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfigKey.java
index 75f0f14..295aa64 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfigKey.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbConfigKey.java
@@ -23,7 +23,7 @@ import org.apache.kerby.kerberos.kerb.common.SectionConfigKey;
 
 public enum KrbConfigKey implements SectionConfigKey {
     KRB_DEBUG(true),
-    KDC_HOST("localhost"),
+    KDC_HOST("localhost", "libdefaults"),
     KDC_PORT(null, "libdefaults"),
     KDC_ALLOW_UDP(false),
     KDC_ALLOW_TCP(false),

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5ffd0a28/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/TestKrbConfigLoad.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/TestKrbConfigLoad.java
b/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/TestKrbConfigLoad.java
index 46c28ad..fa21e5b 100644
--- a/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/TestKrbConfigLoad.java
+++ b/kerby-kerb/kerb-client/src/test/java/org/apache/kerby/kerberos/kerb/client/TestKrbConfigLoad.java
@@ -40,9 +40,9 @@ public class TestKrbConfigLoad {
 
         KrbConfig krbConfig = new KrbConfig();
         krbConfig.addIniConfig(confFile);
-
         assertThat(krbConfig.getDefaultRealm()).isEqualTo("KRB.COM");
         assertThat(krbConfig.getKdcRealm()).isEqualTo("TEST.COM");
+        assertThat(krbConfig.getKdcHost()).isEqualTo("kdc-server.example.com");
         assertThat(krbConfig.getDnsLookUpKdc()).isFalse();
         assertThat(krbConfig.getDnsLookUpRealm()).isFalse();
         assertThat(krbConfig.getAllowWeakCrypto()).isTrue();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5ffd0a28/kerby-kerb/kerb-client/src/test/resources/krb5.conf
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/test/resources/krb5.conf b/kerby-kerb/kerb-client/src/test/resources/krb5.conf
index 3c582f6..1a5b35e 100644
--- a/kerby-kerb/kerb-client/src/test/resources/krb5.conf
+++ b/kerby-kerb/kerb-client/src/test/resources/krb5.conf
@@ -17,6 +17,7 @@
 #
 [libdefaults]
   default_realm = KRB.COM
+  kdc_host = kdc-server.example.com
   kdc_realm = TEST.COM
   dns_lookup_kdc = false
   dns_lookup_realm = false
@@ -30,28 +31,28 @@
   default_tgs_enctypes = des-cbc-crc
   default_tkt_enctypes = des-cbc-crc
 [realms]
-#  ATHENA.MIT.EDU = {
-#		admin_server = KERBEROS.MIT.EDU
-#		default_domain = MIT.EDU
-#		v4_instance_convert = {
-#			mit = mit.edu
-#			lithium = lithium.lcs.mit.edu
-#		}
-#	}
-#	ANDREW.CMU.EDU = {
-#	  admin_server = vice28.fs.andrew.cmu.edu
-#	}
-#  GNU.ORG = {
-#    kdc = kerberos.gnu.org
-#    kdc = kerberos-2.gnu.org
-#    admin_server = kerberos.gnu.org
-#  }
+  ATHENA.MIT.EDU = {
+        admin_server = KERBEROS.MIT.EDU
+        default_domain = MIT.EDU
+        v4_instance_convert = {
+            mit = mit.edu
+            lithium = lithium.lcs.mit.edu
+        }
+    }
+    ANDREW.CMU.EDU = {
+      admin_server = vice28.fs.andrew.cmu.edu
+    }
+  GNU.ORG = {
+    kdc = kerberos.gnu.org
+    kdc = kerberos-2.gnu.org
+    admin_server = kerberos.gnu.org
+ }
 [domain_realm]
   .mit.edu = ATHENA.MIT.EDU
-	mit.edu = ATHENA.MIT.EDU
-	.media.mit.edu = MEDIA-LAB.MIT.EDU
-	media.mit.edu = MEDIA-LAB.MIT.EDU
-	.ucsc.edu = CATS.UCSC.EDU
+    mit.edu = ATHENA.MIT.EDU
+    .media.mit.edu = MEDIA-LAB.MIT.EDU
+    media.mit.edu = MEDIA-LAB.MIT.EDU
+    .ucsc.edu = CATS.UCSC.EDU
 [logging]
  default = FILE:/var/log/krb5libs.log
  kdc = FILE:/var/log/krb5kdc.log


Mime
View raw message