summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"));