[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pki-devel] [PATCH] 265 - fix code to add replicationdb password



The replicationdb password is an instance parameter and should
be created by the first subsystem in the instance.  This should
happen independently of whether replication is being set up
in case it is needed to set up replication (as a master) later.

As IPA figured out when trying out setupReplication=False, failure
to set the replication password in the first subsystem
ends up breaking instance restart because of password checks on startup.

Please review,
Ade

 
>From 1446eac9055b33f705228a34e7794a9b7e5f1314 Mon Sep 17 00:00:00 2001
From: Ade Lee <alee redhat com>
Date: Fri, 24 Jul 2015 15:07:02 -0400
Subject: [PATCH] Fix code to add replicationdb password unless already present

The replicationdb password is an instance parameter and should
be created by the first subsystem in the instance.  This should
happen independantly of whether replication is being set up
in case it is needed to set up replication (as a master) later.

Related to Ticket 1414
---
 base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
index e7a99601b473aca6a466873d4a776044d5e16e22..31891ca623df5171a5667481e76968b9e3d49e35 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
@@ -713,7 +713,7 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
             passwordFile = cs.getString("passwordFile");
             psStore = CMS.createFileConfigStore(passwordFile);
             psStore.putString("internaldb", data.getBindpwd());
-            if (data.getSetupReplication()) {
+            if (StringUtils.isEmpty(psStore.getString("replicationdb", null))) {
                 psStore.putString("replicationdb", replicationPassword);
             }
             psStore.commit(false);
-- 
1.9.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]