summaryrefslogtreecommitdiffstats
path: root/base/server/cmscore/src/com/netscape/cmscore
diff options
context:
space:
mode:
Diffstat (limited to 'base/server/cmscore/src/com/netscape/cmscore')
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
index a7974430f..199a5576e 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/profile/LDAPProfileSubsystem.java
@@ -29,6 +29,7 @@ import java.util.Vector;
import netscape.ldap.LDAPAttribute;
import netscape.ldap.LDAPConnection;
import netscape.ldap.LDAPControl;
+import netscape.ldap.LDAPDN;
import netscape.ldap.LDAPEntry;
import netscape.ldap.LDAPException;
import netscape.ldap.LDAPSearchConstraints;
@@ -107,8 +108,13 @@ public class LDAPProfileSubsystem
IPluginRegistry registry = (IPluginRegistry)
CMS.getSubsystem(CMS.SUBSYSTEM_REGISTRY);
- String profileId = (String)
- ldapProfile.getAttribute("cn").getStringValues().nextElement();
+ String profileId = null;
+ String dn = ldapProfile.getDN();
+ if (!dn.startsWith("cn=")) {
+ CMS.debug("Error reading profile entry: DN " + dn + " does not start with 'cn='");
+ return;
+ }
+ profileId = LDAPDN.explodeDN(dn, true)[0];
String classId = (String)
ldapProfile.getAttribute("classId").getStringValues().nextElement();
@@ -219,13 +225,14 @@ public class LDAPProfileSubsystem
}
private void forgetProfile(LDAPEntry entry) {
- String profileId = (String)
- entry.getAttribute("cn").getStringValues().nextElement();
- if (profileId == null) {
- CMS.debug("forgetProfile: error retrieving cn (profileId) from LDAPEntry");
- } else {
- forgetProfile(profileId);
+ String profileId = null;
+ String dn = entry.getDN();
+ if (!dn.startsWith("cn=")) {
+ CMS.debug("forgetProfile: DN " + dn + " does not start with 'cn='");
+ return;
}
+ profileId = LDAPDN.explodeDN(dn, true)[0];
+ forgetProfile(profileId);
}
/**