directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject directory-kerby git commit: DIRKRB-456 KinitTool doesn't work to use keytab file
Date Sat, 14 Nov 2015 13:45:04 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master cae0be35d -> 955a84585


DIRKRB-456 KinitTool doesn't work to use keytab file


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

Branch: refs/heads/master
Commit: 955a84585c937561750a761134711b0ad4fdfeff
Parents: cae0be3
Author: Kai Zheng <kai.zheng@intel.com>
Authored: Sat Nov 14 21:44:41 2015 +0800
Committer: Kai Zheng <kai.zheng@intel.com>
Committed: Sat Nov 14 21:44:41 2015 +0800

----------------------------------------------------------------------
 .../java/org/apache/kerby/kerberos/tool/ToolUtil.java   | 12 +++++++-----
 .../apache/kerby/kerberos/tool/kinit/KinitOption.java   |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/955a8458/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/ToolUtil.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/ToolUtil.java
b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/ToolUtil.java
index 567662a..91f8aef 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/ToolUtil.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/ToolUtil.java
@@ -30,16 +30,18 @@ public class ToolUtil {
 
     /**
      * Convert tool (like kinit) options to KrbOptions.
-     * @param krbOptions krb options
+     * @param toolOptions krb options
      * @return krb options
      */
-    public static KOptions convertOptions(KOptions krbOptions) {
+    public static KOptions convertOptions(KOptions toolOptions) {
         KOptions results = new KOptions();
 
-        for (KOption toolOpt : krbOptions.getOptions()) {
+        for (KOption toolOpt : toolOptions.getOptions()) {
             KrbOption krbOpt = KrbOption.fromOptionName(toolOpt.getOptionName());
-            krbOpt.setValue(toolOpt.getValue());
-            results.add(krbOpt);
+            if (krbOpt != KrbOption.NONE) {
+                krbOpt.setValue(toolOpt.getValue());
+                results.add(krbOpt);
+            }
         }
 
         return results;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/955a8458/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitOption.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitOption.java
b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitOption.java
index e7a7f8b..23a7091 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitOption.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/kinit/KinitOption.java
@@ -43,7 +43,7 @@ public enum KinitOption implements KOption {
     USER_PASSWD("user-passwd", "User plain password"),
     USE_KEYTAB("-k", "use keytab"),
     USE_DFT_KEYTAB("-i", "use default client keytab (with -k)"),
-    USER_KEYTAB_FILE("-t", "filename of keytab to use", KOptionType.STR),
+    KEYTAB_FILE("-t", "filename of keytab to use", KOptionType.FILE),
     KRB5_CACHE("-c", "Kerberos 5 cache name", KOptionType.STR),
     SERVICE("-S", "service", KOptionType.STR),
     ARMOR_CACHE("-T", "armor credential cache", KOptionType.FILE),


Mime
View raw message