directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [directory-kerby] branch trunk updated: DIRKRB-748 Need to replace KDC host when initKrb5conf generates krb5.conf. Contributed by Jiayi Liu.
Date Fri, 07 Aug 2020 05:15:44 GMT
This is an automated email from the ASF dual-hosted git repository.

plusplusjiajia pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/directory-kerby.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f8a12e3  DIRKRB-748 Need to replace KDC host when initKrb5conf generates krb5.conf.
Contributed by Jiayi Liu.
f8a12e3 is described below

commit f8a12e3808a2c27f6b44265e8529238821f108df
Author: Li Jiajia <ljj270386@alibaba-inc.com>
AuthorDate: Fri Aug 7 13:15:33 2020 +0800

    DIRKRB-748 Need to replace KDC host when initKrb5conf generates krb5.conf. Contributed
by Jiayi Liu.
---
 .../src/main/java/org/apache/kerby/kerberos/kerb/admin/Krb5Conf.java    | 1 +
 .../src/main/java/org/apache/kerby/kerberos/tool/kadmin/Krb5Conf.java   | 1 +
 kerby-tool/kdc-tool/src/main/resources/krb5.conf                        | 2 +-
 kerby-tool/kdc-tool/src/main/resources/krb5_udp.conf                    | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/Krb5Conf.java
b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/Krb5Conf.java
index cfc266c..0222b23 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/Krb5Conf.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/Krb5Conf.java
@@ -57,6 +57,7 @@ public class Krb5Conf {
         String content = templateContent;
 
         content = content.replaceAll("_REALM_", "" + kdcConfig.getKdcRealm());
+        content = content.replaceAll("_KDC_HOST_", "" + kdcConfig.getKdcHost());
 
         int kdcPort = kdcConfig.allowUdp() ? kdcConfig.getKdcUdpPort()
                 : kdcConfig.getKdcTcpPort();
diff --git a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/Krb5Conf.java
b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/Krb5Conf.java
index 848afe1..3f7ec7a 100644
--- a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/Krb5Conf.java
+++ b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/Krb5Conf.java
@@ -57,6 +57,7 @@ public class Krb5Conf {
         String content = templateContent;
 
         content = content.replaceAll("_REALM_", "" + kdcConfig.getKdcRealm());
+        content = content.replaceAll("_KDC_HOST_", "" + kdcConfig.getKdcHost());
 
         int kdcPort = kdcConfig.allowUdp() ? kdcConfig.getKdcUdpPort()
                 : kdcConfig.getKdcTcpPort();
diff --git a/kerby-tool/kdc-tool/src/main/resources/krb5.conf b/kerby-tool/kdc-tool/src/main/resources/krb5.conf
index 0954538..169572d 100644
--- a/kerby-tool/kdc-tool/src/main/resources/krb5.conf
+++ b/kerby-tool/kdc-tool/src/main/resources/krb5.conf
@@ -25,5 +25,5 @@
 
 [realms]
     _REALM_ = {
-        kdc = localhost:_KDC_PORT_
+        kdc = _KDC_HOST_:_KDC_PORT_
     }
\ No newline at end of file
diff --git a/kerby-tool/kdc-tool/src/main/resources/krb5_udp.conf b/kerby-tool/kdc-tool/src/main/resources/krb5_udp.conf
index 0954538..169572d 100644
--- a/kerby-tool/kdc-tool/src/main/resources/krb5_udp.conf
+++ b/kerby-tool/kdc-tool/src/main/resources/krb5_udp.conf
@@ -25,5 +25,5 @@
 
 [realms]
     _REALM_ = {
-        kdc = localhost:_KDC_PORT_
+        kdc = _KDC_HOST_:_KDC_PORT_
     }
\ No newline at end of file


Mime
View raw message