directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [2/5] directory-kerby git commit: refine persistTofile() method in JsonIdentityBackend.java and close the FileInputStream after used in IOUtil.java
Date Thu, 05 Nov 2015 07:08:25 GMT
refine persistTofile() method in JsonIdentityBackend.java and close the FileInputStream after
used in IOUtil.java


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

Branch: refs/heads/pkinit-support
Commit: 44f40d11d8cf2d9017278d92aec5d9f48d3fb88d
Parents: ed68699
Author: yaningxu <yaning0123@gmail.com>
Authored: Thu Nov 5 14:02:51 2015 +0800
Committer: yaningxu <yaning0123@gmail.com>
Committed: Thu Nov 5 14:02:51 2015 +0800

----------------------------------------------------------------------
 .../kdc/identitybackend/JsonIdentityBackend.java     |   1 +
 kerby-dist/kdc-dist/conf/admin.keytab                | Bin 0 -> 148 bytes
 .../src/main/java/org/apache/kerby/util/IOUtil.java  |   2 ++
 3 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/44f40d11/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
----------------------------------------------------------------------
diff --git a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
index 6139ef3..cc1da07 100644
--- a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
+++ b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
@@ -266,6 +266,7 @@ public class JsonIdentityBackend extends AbstractIdentityBackend {
             File newJsonKdbFile = File.createTempFile("kerby-kdb",
                     ".json", jsonKdbFile.getParentFile());
             IOUtil.writeFile(newJsonContent, newJsonKdbFile);
+            jsonKdbFile.delete();
             newJsonKdbFile.renameTo(jsonKdbFile);
             kdbFileUpdateTime = jsonKdbFile.lastModified();
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/44f40d11/kerby-dist/kdc-dist/conf/admin.keytab
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/conf/admin.keytab b/kerby-dist/kdc-dist/conf/admin.keytab
new file mode 100644
index 0000000..9c3942b
Binary files /dev/null and b/kerby-dist/kdc-dist/conf/admin.keytab differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/44f40d11/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
----------------------------------------------------------------------
diff --git a/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java b/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
index 30bf3ed..9a5cf96 100644
--- a/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
+++ b/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
@@ -41,6 +41,7 @@ public final class IOUtil {
         while ((length = in.read(buffer)) != -1) {
             baos.write(buffer, 0, length);
         }
+        in.close();
         return baos.toByteArray();
     }
 
@@ -56,6 +57,7 @@ public final class IOUtil {
             toRead -= ret;
             off += ret;
         }
+        in.close();
     }
 
     /**


Mime
View raw message