Escape user DN used to build group filter. Fixes MRM-1873

This commit is contained in:
Chris Heyne 2015-02-12 10:49:42 -06:00 committed by Chris Heyne
parent 458bcde3c7
commit 221aa62c8f
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,7 @@ import javax.naming.directory.DirContext;
import javax.naming.directory.ModificationItem; import javax.naming.directory.ModificationItem;
import javax.naming.directory.SearchControls; import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult; import javax.naming.directory.SearchResult;
import javax.naming.ldap.Rdn;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -390,6 +391,9 @@ public class DefaultLdapRoleMapper
} }
groupEntry = builder.toString(); groupEntry = builder.toString();
} }
groupEntry = Rdn.escapeValue(groupEntry);
String filter = String filter =
new StringBuilder().append( "(&" ).append( "(objectClass=" + getLdapGroupClass() + ")" ).append( new StringBuilder().append( "(&" ).append( "(objectClass=" + getLdapGroupClass() + ")" ).append(
"(" ).append( getLdapGroupMember() ).append( "=" ).append( groupEntry ).append( ")" ).append( "(" ).append( getLdapGroupMember() ).append( "=" ).append( groupEntry ).append( ")" ).append(