mirror of
https://github.com/nicolabs/ldap-plugin.git
synced 2025-09-07 05:14:24 +02:00
fixed a possible race condition (INFRADNA-65)
Originally-Committed-As: a9efb3dac2363331e577b08cbd876f890df303f3
This commit is contained in:
parent
baec8a9e47
commit
7697934967
|
@ -436,9 +436,11 @@ public class LDAPSecurityRealm extends AbstractPasswordBasedSecurityRealm {
|
||||||
// intern attributes
|
// intern attributes
|
||||||
Attributes v = ldapUser.getAttributes();
|
Attributes v = ldapUser.getAttributes();
|
||||||
if (v instanceof BasicAttributes) {// BasicAttributes.equals is what makes the interning possible
|
if (v instanceof BasicAttributes) {// BasicAttributes.equals is what makes the interning possible
|
||||||
Attributes vv = (Attributes)attributesCache.get(v);
|
synchronized (attributesCache) {
|
||||||
if (vv==null) attributesCache.put(v,vv=v);
|
Attributes vv = (Attributes)attributesCache.get(v);
|
||||||
user.setAttributes(vv);
|
if (vv==null) attributesCache.put(v,vv=v);
|
||||||
|
user.setAttributes(vv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GrantedAuthority[] extraAuthorities = authoritiesPopulator.getGrantedAuthorities(ldapUser);
|
GrantedAuthority[] extraAuthorities = authoritiesPopulator.getGrantedAuthorities(ldapUser);
|
||||||
|
|
Loading…
Reference in a new issue