directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [1/5] directory-kerby git commit: fix json backend problem that a new json backend database file will be created when new identities added
Date Thu, 05 Nov 2015 07:08:24 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/pkinit-support 4e7a3c0cf -> 87a9f55cf


fix json backend problem that a new json backend database file will be created when new identities
added


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

Branch: refs/heads/pkinit-support
Commit: df2539bed1b4fc59642979ade83abfd8809b53bd
Parents: ed68699
Author: yaningxu <yaning0123@gmail.com>
Authored: Wed Nov 4 18:29:18 2015 +0800
Committer: yaningxu <yaning0123@gmail.com>
Committed: Wed Nov 4 18:29:18 2015 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/df2539be/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..18a75c4 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
@@ -263,10 +263,7 @@ public class JsonIdentityBackend extends AbstractIdentityBackend {
     private void persistToFile() throws KrbException {
         String newJsonContent = gson.toJson(identities);
         try {
-            File newJsonKdbFile = File.createTempFile("kerby-kdb",
-                    ".json", jsonKdbFile.getParentFile());
-            IOUtil.writeFile(newJsonContent, newJsonKdbFile);
-            newJsonKdbFile.renameTo(jsonKdbFile);
+            IOUtil.writeFile(newJsonContent, jsonKdbFile);
             kdbFileUpdateTime = jsonKdbFile.lastModified();
         } catch (IOException e) {
             LOG.error("Error occurred while writing identities to file: " + jsonKdbFile);


Mime
View raw message