diff options
author | Ade Lee <alee@redhat.com> | 2012-05-07 11:14:30 -0400 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2012-05-07 13:59:42 -0400 |
commit | 9ad4d60592fdc37ae89672c29859b8463e183718 (patch) | |
tree | fddd68d299e659e51bfe20c9de083eb59306cc63 /base | |
parent | a1ef21445638aadd9d0f2b58000b11bd1ecb58f3 (diff) | |
download | pki-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.java | 22 |
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")); |