Merge pull request #2383 from ratcashdev/master

Fix when importing empty uniqueMember attributes
This commit is contained in:
Marek Posolda 2016-03-18 12:18:02 +01:00
commit d285721063

View file

@ -35,6 +35,13 @@ public class LDAPDn {
public static LDAPDn fromString(String dnString) {
LDAPDn dn = new LDAPDn();
// In certain OpenLDAP implementations the uniqueMember attribute is mandatory
// Thus, if a new group is created, it will contain an empty uniqueMember attribute
// Later on, when adding members, this empty attribute will be kept
// Keycloak must be able to process it, properly, w/o throwing an ArrayIndexOutOfBoundsException
if(dnString.trim().isEmpty())
return dn;
String[] rdns = dnString.split("(?<!\\\\),");
for (String entryStr : rdns) {
String[] rdn = entryStr.split("(?<!\\\\)=");