You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2015/07/17 08:10:45 UTC

directory-kerby git commit: DIRKRB-381 Allow tcp or udp will be set true if the corresponding port is not null.

Repository: directory-kerby
Updated Branches:
  refs/heads/master ddd6aed98 -> ff3d7be09


DIRKRB-381 Allow tcp or udp will be set true if the corresponding port is not null.


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

Branch: refs/heads/master
Commit: ff3d7be092b7d0c3b0c313018329f8580153f83d
Parents: ddd6aed
Author: plusplusjiajia <ji...@intel.com>
Authored: Fri Jul 17 14:16:10 2015 +0800
Committer: plusplusjiajia <ji...@intel.com>
Committed: Fri Jul 17 14:16:10 2015 +0800

----------------------------------------------------------------------
 kerby-dist/tool-dist/bin/klist.sh                    |  4 ++--
 .../apache/kerby/kerberos/kerb/client/KrbConfig.java | 15 ++++++++++-----
 .../kerby/kerberos/kerb/client/KrbConfigKey.java     |  6 +++---
 .../apache/kerby/kerberos/kerb/server/KdcConfig.java |  6 ++++--
 4 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/ff3d7be0/kerby-dist/tool-dist/bin/klist.sh
----------------------------------------------------------------------
diff --git a/kerby-dist/tool-dist/bin/klist.sh b/kerby-dist/tool-dist/bin/klist.sh
index 360c7d7..bf1c6ad 100644
--- a/kerby-dist/tool-dist/bin/klist.sh
+++ b/kerby-dist/tool-dist/bin/klist.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
 
-java -Xdebug -Xrunjdwp:transport=dt_socket,address=8004,server=n,suspend=n \
+java -Xdebug -Xrunjdwp:transport=dt_socket,address=8004,server=y,suspend=n \
 -classpath lib/*:. \
- org.apache.kerby.kerberos.tool.klist.KlistTool $@
+org.apache.kerby.kerberos.tool.klist.KlistTool $@

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/ff3d7be0/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 00669d2..fdb95d7 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
@@ -47,7 +47,8 @@ public class KrbConfig extends Conf {
      * @return
      */
     public int getKdcPort() {
-        Integer kdcPort = getInt(KrbConfigKey.KDC_PORT);
+        Integer kdcPort = KrbConfHelper.getIntUnderSection(this,
+                KrbConfigKey.KDC_PORT);
         if (kdcPort != null) {
             return kdcPort.shortValue();
         }
@@ -59,7 +60,8 @@ public class KrbConfig extends Conf {
      * @return
      */
     public int getKdcTcpPort() {
-        Integer kdcPort = getInt(KrbConfigKey.KDC_TCP_PORT);
+        Integer kdcPort = KrbConfHelper.getIntUnderSection(this,
+                KrbConfigKey.KDC_TCP_PORT);
         if (kdcPort != null && kdcPort > 0) {
             return kdcPort.shortValue();
         }
@@ -71,7 +73,8 @@ public class KrbConfig extends Conf {
      * @return true to allow UDP, false otherwise
      */
     public boolean allowKdcUdp() {
-        return getBoolean(KrbConfigKey.KDC_ALLOW_UDP);
+        return getBoolean(KrbConfigKey.KDC_ALLOW_UDP) || KrbConfHelper.getIntUnderSection(this,
+                KrbConfigKey.KDC_UDP_PORT) != null;
     }
 
     /**
@@ -79,14 +82,16 @@ public class KrbConfig extends Conf {
      * @return true to allow TCP, false otherwise
      */
     public boolean allowKdcTcp() {
-        return getBoolean(KrbConfigKey.KDC_ALLOW_TCP);
+        return getBoolean(KrbConfigKey.KDC_ALLOW_TCP) || KrbConfHelper.getIntUnderSection(this,
+                KrbConfigKey.KDC_TCP_PORT) != null;
     }
     /**
      * Get KDC UDP port
      * @return
      */
     public int getKdcUdpPort() {
-        Integer kdcPort = getInt(KrbConfigKey.KDC_UDP_PORT);
+        Integer kdcPort = KrbConfHelper.getIntUnderSection(this,
+                KrbConfigKey.KDC_UDP_PORT);
         if (kdcPort != null && kdcPort > 0) {
             return kdcPort.shortValue();
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/ff3d7be0/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 3dc3ced..75f0f14 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
@@ -24,11 +24,11 @@ import org.apache.kerby.kerberos.kerb.common.SectionConfigKey;
 public enum KrbConfigKey implements SectionConfigKey {
     KRB_DEBUG(true),
     KDC_HOST("localhost"),
-    KDC_PORT(),
+    KDC_PORT(null, "libdefaults"),
     KDC_ALLOW_UDP(false),
     KDC_ALLOW_TCP(false),
-    KDC_UDP_PORT(),
-    KDC_TCP_PORT(),
+    KDC_UDP_PORT(null, "libdefaults"),
+    KDC_TCP_PORT(null, "libdefaults"),
     KDC_DOMAIN("example.com"),
     KDC_REALM("EXAMPLE.COM", "libdefaults"),
     TGS_PRINCIPAL("krbtgt@EXAMPLE.COM"),

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/ff3d7be0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfig.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfig.java b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfig.java
index e9c4dc9..7b041f1 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfig.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfig.java
@@ -65,7 +65,8 @@ public class KdcConfig extends Conf {
      * @return true to allow TCP, false otherwise
      */
     public Boolean allowTcp() {
-        return getBoolean(KdcConfigKey.KDC_ALLOW_TCP);
+        return getBoolean(KdcConfigKey.KDC_ALLOW_TCP) || KrbConfHelper.getIntUnderSection(this,
+                KdcConfigKey.KDC_TCP_PORT) != null;
     }
 
     /**
@@ -73,7 +74,8 @@ public class KdcConfig extends Conf {
      * @return true to allow UDP, false otherwise
      */
     public Boolean allowUdp() {
-        return getBoolean(KdcConfigKey.KDC_ALLOW_UDP);
+        return getBoolean(KdcConfigKey.KDC_ALLOW_UDP) || KrbConfHelper.getIntUnderSection(this,
+                KdcConfigKey.KDC_UDP_PORT) != null;
     }
 
     public int getKdcUdpPort() {