directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject directory-kerby git commit: DIRKRB-643 Implement kinit -l -r. Contributed by Lin Zeng.
Date Fri, 04 Aug 2017 08:01:55 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/1.0.x-fixes cbe8ab386 -> f9261f919


DIRKRB-643 Implement kinit -l -r. Contributed by Lin Zeng.


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

Branch: refs/heads/1.0.x-fixes
Commit: f9261f919bb00a91329b59e5f362b7e37c95b291
Parents: cbe8ab3
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri Aug 4 15:57:45 2017 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri Aug 4 16:01:51 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/kerby/kerberos/kerb/client/KrbOption.java  | 6 +++---
 .../apache/kerby/kerberos/kerb/client/request/KdcRequest.java  | 6 +++++-
 .../java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java   | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f9261f91/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbOption.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbOption.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbOption.java
index 91de491..79eac5e 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbOption.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbOption.java
@@ -44,11 +44,11 @@ public enum KrbOption implements KOption {
     CONN_TIMEOUT(new KOptionInfo("conn-timeout", "connection timeout",
         KOptionType.INT)),
 
-    LIFE_TIME(new KOptionInfo("life-time", "life time",
+    LIFE_TIME(new KOptionInfo("-l", "life time",
         KOptionType.INT)),
-    START_TIME(new KOptionInfo("start-time", "start time",
+    START_TIME(new KOptionInfo("-s", "start time",
         KOptionType.INT)),
-    RENEWABLE_TIME(new KOptionInfo("renewable_lifetime", "renewable lifetime",
+    RENEWABLE_TIME(new KOptionInfo("-r", "renewable lifetime",
         KOptionType.INT)),
     INCLUDE_ADDRESSES(new KOptionInfo("include_addresses",
         "include addresses")),

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f9261f91/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
index 7c241ab..4b60d7b 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
@@ -304,7 +304,11 @@ public abstract class KdcRequest {
     public abstract EncryptionKey getClientKey() throws KrbException;
 
     public long getTicketValidTime() {
-        return context.getTicketValidTime();
+        if (getRequestOptions().contains(KrbOption.LIFE_TIME)) {
+            return getRequestOptions().getIntegerOption(KrbOption.LIFE_TIME) * 1000;
+        } else {
+            return context.getTicketValidTime();
+        }
     }
 
     public KerberosTime getTicketTillTime() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f9261f91/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
index f2e585c..8ad13a9 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitTool.java
@@ -171,8 +171,8 @@ public class KinitTool {
         }
 
         File ccacheFile;
-        if (ktOptions.contains(KrbOption.KRB5_CACHE)) {
-            String ccacheName = ktOptions.getStringOption(KrbOption.KRB5_CACHE);
+        if (ktOptions.contains(KinitOption.KRB5_CACHE)) {
+            String ccacheName = ktOptions.getStringOption(KinitOption.KRB5_CACHE);
             ccacheFile = new File(ccacheName);
         } else {
             String ccacheName = principal.replaceAll("/", "_");


Mime
View raw message