summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2012-05-07 11:14:30 -0400
committerAde Lee <alee@redhat.com>2012-05-07 13:59:42 -0400
commit9ad4d60592fdc37ae89672c29859b8463e183718 (patch)
treefddd68d299e659e51bfe20c9de083eb59306cc63 /base
parenta1ef21445638aadd9d0f2b58000b11bd1ecb58f3 (diff)
downloadpki-9ad4d60592fdc37ae89672c29859b8463e183718.tar.gz
pki-9ad4d60592fdc37ae89672c29859b8463e183718.tar.xz
pki-9ad4d60592fdc37ae89672c29859b8463e183718.zip
BZ 819111 - non existent container ou=cmsusers breaks replication
Added code to create container on master if it does not exist.
Diffstat (limited to 'base')
-rw-r--r--base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
index d491da07c..5328fc054 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
@@ -1591,7 +1591,27 @@ public class ConfigurationUtils {
throws LDAPException {
LDAPAttributeSet attrs = null;
LDAPEntry entry = null;
- String dn = "cn=" + bindUser + ",ou=csusers,cn=config";
+
+ // for older subsystems, the container ou=csusers, cn=config may not yet exist
+ String dn = "ou=csusers, cn=config";
+ try {
+ attrs = new LDAPAttributeSet();
+ attrs.add(new LDAPAttribute("objectclass", "top"));
+ attrs.add(new LDAPAttribute("objectclass", "organizationalUnit"));
+ attrs.add(new LDAPAttribute("ou", "csusers"));
+ entry = new LDAPEntry(dn, attrs);
+ conn.add(entry);
+ } catch (LDAPException e) {
+ if (e.getLDAPResultCode() == LDAPException.ENTRY_ALREADY_EXISTS) {
+ CMS.debug("createReplicationManager: containing ou already exists");
+ } else {
+ CMS.debug("createReplicationManager: Failed to create containing ou. Exception: "
+ + e.toString());
+ throw e;
+ }
+ }
+
+ dn = "cn=" + bindUser + ",ou=csusers,cn=config";
try {
attrs = new LDAPAttributeSet();
attrs.add(new LDAPAttribute("objectclass", "top"));