directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [09/26] directory-kerby git commit: Fix the Usage of tools.
Date Mon, 10 Aug 2015 05:15:50 GMT
Fix the Usage of tools.


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

Branch: refs/heads/pkinit-support
Commit: 3863cb5a3ae1d3ef558f2b543ad9603d1617e225
Parents: a8865a0
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Wed Aug 5 10:13:39 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Wed Aug 5 10:13:39 2015 +0800

----------------------------------------------------------------------
 .../apache/kerby/kerberos/kdc/KerbyKdcServer.java  |  6 +++---
 .../kerby/kerberos/tool/kinit/KinitTool.java       | 17 +++++++++--------
 .../kerby/kerberos/tool/klist/KlistTool.java       |  2 +-
 .../kerby/kerberos/tool/kadmin/KadminTool.java     |  2 +-
 .../kerby/kerberos/tool/kdcinit/KdcInitTool.java   |  6 +++---
 5 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3863cb5a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/KerbyKdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/KerbyKdcServer.java b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/KerbyKdcServer.java
index 4ca600e..720e393 100644
--- a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/KerbyKdcServer.java
+++ b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/KerbyKdcServer.java
@@ -48,9 +48,9 @@ public class KerbyKdcServer extends KdcServer {
         kadmin.checkBuiltinPrincipals();
     }
 
-    private static final String USAGE = "Usage: "
-            + KerbyKdcServer.class.getSimpleName()
-            + " -start <conf-dir> <working-dir>";
+    private static final String USAGE = "Usage: sh bin/start-kdc.sh [conf-dir] [working-dir]
\n"
+        + "\tExample:\n"
+        + "\t\tsh bin/start-kdc.sh conf /tmp\n";
 
     public static void main(String[] args) throws KrbException {
         if (args.length != 3) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3863cb5a/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 769f0c9..896a1e4 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
@@ -39,7 +39,7 @@ import java.util.Scanner;
 public class KinitTool {
 
     private static final String USAGE =
-            "Usage: kinit -conf conf_dir [-V] [-l lifetime] [-s start_time]\n"
+            "Usage: sh bin/kinit.sh [-conf conf_dir] [-V] [-l lifetime] [-s start_time]\n"
                     + "\t\t[-r renewable_life] [-f | -F] [-p | -P] -n [-a | -A] [-C] [-E]\n"
                     + "\t\t[-v] [-R] [-k [-i|-t keytab_file]] [-c cachename]\n"
                     + "\t\t[-S service_name] [-T ticket_armor_cache]\n"
@@ -104,6 +104,13 @@ public class KinitTool {
                                       KOptions ktOptions) throws Exception {
         ktOptions.add(KinitOption.CLIENT_PRINCIPAL, principal);
 
+        File confDir = null;
+        if (ktOptions.contains(KinitOption.CONF_DIR)) {
+            confDir = ktOptions.getDirOption(KinitOption.CONF_DIR);
+        } else {
+            printUsage("Can't get the conf dir!");
+        }
+
         //If not request tickets by keytab than by password.
         if (!ktOptions.contains(KinitOption.USE_KEYTAB)) {
             ktOptions.add(KinitOption.USE_PASSWD);
@@ -111,18 +118,12 @@ public class KinitTool {
             ktOptions.add(KinitOption.USER_PASSWD, password);
         }
 
-        File confDir = null;
-        if (ktOptions.contains(KinitOption.CONF_DIR)) {
-            confDir = ktOptions.getDirOption(KinitOption.CONF_DIR);
-        } else {
-            printUsage("Can't get the conf dir!");
-        }
         KrbClient krbClient = getClient(confDir);
         TgtTicket tgt = krbClient.requestTgtWithOptions(
                 ToolUtil.convertOptions(ktOptions));
 
         if (tgt == null) {
-            System.err.println("Requesting TGT failed");
+            System.err.println("Requesting TGT failed.");
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3863cb5a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/klist/KlistTool.java
----------------------------------------------------------------------
diff --git a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/klist/KlistTool.java
b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/klist/KlistTool.java
index 14d8a12..6e57359 100644
--- a/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/klist/KlistTool.java
+++ b/kerby-tool/client-tool/src/main/java/org/apache/kerby/kerberos/tool/klist/KlistTool.java
@@ -43,7 +43,7 @@ import java.util.List;
 public class KlistTool {
 
     private static  final String USAGE =
-            "Usage: klist [-e] [-V] [[-c] [-l] [-A] [-d] [-f] [-s] "
+            "Usage: sh bin/klist.sh [-e] [-V] [[-c] [-l] [-A] [-d] [-f] [-s] "
                     + "[-a [-n]]] [-k [-t] [-K]] [name]\n"
                     + "\t-c specifies credentials cache\n"
                     + "\t-k specifies keytab\n"

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3863cb5a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/KadminTool.java
----------------------------------------------------------------------
diff --git a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/KadminTool.java
b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/KadminTool.java
index 2706480..d14b386 100644
--- a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/KadminTool.java
+++ b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/KadminTool.java
@@ -78,7 +78,7 @@ public class KadminTool {
             + "quit, exit, q            Exit program.";
 
     private static final String USAGE =
-        "Usage: sh bin/kadmin.sh <conf-dir> [-c cache_name]|[-k keytab]\n"
+        "Usage: sh bin/kadmin.sh [conf-dir] [-c cache_name]|[-k keytab]\n"
             + "\tExample:\n"
             + "\t\tsh bin/kadmin.sh conf -k /home/admin.keytab\n";
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/3863cb5a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kdcinit/KdcInitTool.java
----------------------------------------------------------------------
diff --git a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kdcinit/KdcInitTool.java
b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kdcinit/KdcInitTool.java
index ca3c201..8e6b809 100644
--- a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kdcinit/KdcInitTool.java
+++ b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kdcinit/KdcInitTool.java
@@ -28,9 +28,9 @@ public class KdcInitTool {
     private Kadmin kadmin;
     private static File keytabFile;
 
-    private static final String USAGE = "Usage: "
-        + KdcInitTool.class.getSimpleName()
-        + " conf-dir keytab";
+    private static final String USAGE = "Usage: sh bin/kdcinit.sh [conf-dir] [keytab]\n"
+        + "\tExample:\n"
+        + "\t\tsh bin/kdcinit.sh conf /home/admin.keytab\n";
 
     private void init(File confDir) throws KrbException {
         kadmin = new Kadmin(confDir);


Mime
View raw message