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: Print USAGE when no principal name in keytab add command.
Date Thu, 18 Jun 2015 06:39:28 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 1be7fcd48 -> 491202f36


Print USAGE when no principal name in keytab add command.


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

Branch: refs/heads/master
Commit: 491202f366d1c9bf37b2189a50a6fc04f7e4432f
Parents: 1be7fcd
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Thu Jun 18 14:44:37 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Thu Jun 18 14:44:37 2015 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/tool/kadmin/executor/KeytabAddExecutor.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/491202f3/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/executor/KeytabAddExecutor.java
----------------------------------------------------------------------
diff --git a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/executor/KeytabAddExecutor.java
b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/executor/KeytabAddExecutor.java
index 4b38f0f..59a102e 100644
--- a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/executor/KeytabAddExecutor.java
+++ b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/executor/KeytabAddExecutor.java
@@ -67,6 +67,11 @@ public class KeytabAddExecutor implements KadminCommandExecutor{
         }
         File keytabFile = new File(keytabFileLocation);
 
+        if (principal == null || !keytabFile.exists()) {
+            System.err.println(USAGE);
+            return;
+        }
+
         Kadmin kadmin = new Kadmin(backendConfig);
         try {
         StringBuffer result = kadmin.addEntryToKeytab(keytabFile, principal);


Mime
View raw message