You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by co...@apache.org on 2017/05/03 11:52:49 UTC

[1/3] directory-kerby git commit: Make AdminHelper static methods public

Repository: directory-kerby
Updated Branches:
  refs/heads/trunk 405898e04 -> fd02601ec


Make AdminHelper static methods public


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

Branch: refs/heads/trunk
Commit: 90795243b96e7c98865c92db86405c2299fdf118
Parents: 405898e
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 3 12:29:22 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed May 3 12:29:22 2017 +0100

----------------------------------------------------------------------
 .../kerb/admin/kadmin/local/AdminHelper.java    | 30 ++++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/90795243/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
index f78ec45..8276a43 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.kerby.kerberos.kerb.admin.kadmin.local;
 
@@ -52,7 +52,7 @@ public final class AdminHelper {
      * @param identity  The identity
      * @throws KrbException
      */
-    static void exportKeytab(File keytabFile, KrbIdentity identity)
+    public static void exportKeytab(File keytabFile, KrbIdentity identity)
             throws KrbException {
 
         Keytab keytab = createOrLoadKeytab(keytabFile);
@@ -70,7 +70,7 @@ public final class AdminHelper {
      * @param identities  Identities to export to keytabFile
      * @throws KrbException
      */
-    static void exportKeytab(File keytabFile, List<KrbIdentity> identities)
+    public static void exportKeytab(File keytabFile, List<KrbIdentity> identities)
             throws KrbException {
 
         Keytab keytab = createOrLoadKeytab(keytabFile);
@@ -89,7 +89,7 @@ public final class AdminHelper {
      * @return The keytab load from keytab file
      * @throws KrbException
      */
-    static Keytab loadKeytab(File keytabFile) throws KrbException {
+    public static Keytab loadKeytab(File keytabFile) throws KrbException {
         Keytab keytab;
         try {
             keytab = Keytab.loadKeytab(keytabFile);
@@ -108,7 +108,7 @@ public final class AdminHelper {
      * @return The keytab load from keytab file
      * @throws KrbException
      */
-    static Keytab createOrLoadKeytab(File keytabFile) throws KrbException {
+    public static Keytab createOrLoadKeytab(File keytabFile) throws KrbException {
 
         Keytab keytab;
         try {
@@ -135,7 +135,7 @@ public final class AdminHelper {
      * @param identity  The identity
      * @throws KrbException
      */
-    static void exportToKeytab(Keytab keytab, KrbIdentity identity)
+    public static void exportToKeytab(Keytab keytab, KrbIdentity identity)
         throws KrbException {
 
         //Add principal to keytab.
@@ -155,7 +155,7 @@ public final class AdminHelper {
      * @param keytabFile The keytab file
      * @throws KrbException
      */
-    static void storeKeytab(Keytab keytab, File keytabFile) throws KrbException {
+    public static void storeKeytab(Keytab keytab, File keytabFile) throws KrbException {
         try {
             keytab.store(keytabFile);
         } catch (IOException e) {
@@ -171,7 +171,7 @@ public final class AdminHelper {
      * @param principalName  The principal name
      * @throws KrbException
      */
-    static void removeKeytabEntriesOf(File keytabFile,
+    public static void removeKeytabEntriesOf(File keytabFile,
                                              String principalName) throws KrbException {
         Keytab keytab = loadKeytab(keytabFile);
 
@@ -206,7 +206,7 @@ public final class AdminHelper {
      * @param principalName  The principal name
      * @throws KrbException
      */
-    static void removeOldKeytabEntriesOf(File keytabFile,
+    public static void removeOldKeytabEntriesOf(File keytabFile,
                                                 String principalName) throws KrbException {
         Keytab keytab = loadKeytab(keytabFile);
 
@@ -235,7 +235,7 @@ public final class AdminHelper {
      * @param principal The principal name to be created
      * @param kOptions  The KOptions with principal info
      */
-    static KrbIdentity createIdentity(String principal, KOptions kOptions)
+    public static KrbIdentity createIdentity(String principal, KOptions kOptions)
         throws KrbException {
         KrbIdentity kid = new KrbIdentity(principal);
         kid.setCreatedTime(KerberosTime.now());
@@ -263,7 +263,7 @@ public final class AdminHelper {
      * @param kOptions  The KOptions with changed principal info
      * @throws KrbException
      */
-    static void updateIdentity(KrbIdentity identity, KOptions kOptions) {
+    public static void updateIdentity(KrbIdentity identity, KOptions kOptions) {
         if (kOptions.contains(KadminOption.EXPIRE)) {
             Date date = kOptions.getDateOption(KadminOption.EXPIRE);
             identity.setExpireTime(new KerberosTime(date.getTime()));
@@ -284,7 +284,7 @@ public final class AdminHelper {
      * @return pattern
      * @throws KrbException
      */
-    static Pattern getPatternFromGlobPatternString(String globString) throws KrbException {
+    public static Pattern getPatternFromGlobPatternString(String globString) throws KrbException {
         if (globString == null || globString.equals("")) {
             return null;
         }


[3/3] directory-kerby git commit: Output the keytab filename in the exception message

Posted by co...@apache.org.
Output the keytab filename in the exception message


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

Branch: refs/heads/trunk
Commit: fd02601ec588bf90599f48ea0d18a54bab6d8315
Parents: 5e84ee4
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 3 12:47:14 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed May 3 12:47:14 2017 +0100

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/fd02601e/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
index 8276a43..3d8083e 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/AdminHelper.java
@@ -122,7 +122,8 @@ public final class AdminHelper {
                 keytab = Keytab.loadKeytab(keytabFile);
             }
         } catch (IOException e) {
-            throw new KrbException("Failed to load or create keytab", e);
+            throw new KrbException("Failed to load or create keytab "
+                + keytabFile.getAbsolutePath(), e);
         }
 
         return keytab;


[2/3] directory-kerby git commit: NPE fixes

Posted by co...@apache.org.
NPE fixes


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

Branch: refs/heads/trunk
Commit: 5e84ee43ff04b0f9e90cd80db6ec3eb33a658c9b
Parents: 9079524
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 3 12:30:55 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed May 3 12:30:55 2017 +0100

----------------------------------------------------------------------
 .../kerberos/kdc/impl/NettyKdcServerImpl.java   | 26 +++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5e84ee43/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
index 5c527f1..1ab3d5e 100644
--- a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
+++ b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
@@ -80,19 +80,23 @@ public class NettyKdcServerImpl extends AbstractInternalKdcServer {
     protected void doStop() throws Exception {
         super.doStop();
 
-        network.stop();
+        if (network != null) {
+            network.stop();
+        }
 
-        executor.shutdown();
+        if (executor != null) {
+            executor.shutdown();
 
-        try {
-            boolean terminated = false;
-            do {
-                // wait until the pool has terminated
-                terminated = executor.awaitTermination(60, TimeUnit.SECONDS);
-            } while (!terminated);
-        } catch (InterruptedException e) {
-            executor.shutdownNow();
-            LOG.warn("waitForTermination interrupted");
+            try {
+                boolean terminated = false;
+                do {
+                    // wait until the pool has terminated
+                    terminated = executor.awaitTermination(60, TimeUnit.SECONDS);
+                } while (!terminated);
+            } catch (InterruptedException e) {
+                executor.shutdownNow();
+                LOG.warn("waitForTermination interrupted");
+            }
         }
         LOG.info("Netty kdc server stopped.");
     }