diff options
author | Ade Lee <alee@redhat.com> | 2012-05-07 11:55:37 -0400 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2012-05-07 11:55:37 -0400 |
commit | 2566d4ddfb533d81fe6203d8457b52e7423b418e (patch) | |
tree | 22730b2596da6a78540a44b50e0c131afd840a32 /base | |
parent | f103db30263625858736595902863f93cff808fe (diff) | |
download | pki-2566d4ddfb533d81fe6203d8457b52e7423b418e.tar.gz pki-2566d4ddfb533d81fe6203d8457b52e7423b418e.tar.xz pki-2566d4ddfb533d81fe6203d8457b52e7423b418e.zip |
BZ 819111 non-existent container breaks replication
Added code to add the required ou=cmsusers container to cn=config
on the master if it does not exist, when replication users are set up.
Diffstat (limited to 'base')
-rw-r--r-- | base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java b/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java index 6c8cbbb19..4a78e4054 100644 --- a/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java +++ b/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java @@ -1238,7 +1238,27 @@ public class DatabasePanel extends WizardPanelBase { 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")); |