mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
fixed a possible race condition (INFRADNA-65)
This commit is contained in:
1 parent
12ab40501a
commit
a9efb3dac2
1 file changed
+5
-3
@@ -436,9 +436,11 @@ public class LDAPSecurityRealm extends AbstractPasswordBasedSecurityRealm {
|
||||
// intern attributes
|
||||
Attributes v = ldapUser.getAttributes();
|
||||
if (v instanceof BasicAttributes) {// BasicAttributes.equals is what makes the interning possible
|
||||
Attributes vv = (Attributes)attributesCache.get(v);
|
||||
if (vv==null) attributesCache.put(v,vv=v);
|
||||
user.setAttributes(vv);
|
||||
synchronized (attributesCache) {
|
||||
Attributes vv = (Attributes)attributesCache.get(v);
|
||||
if (vv==null) attributesCache.put(v,vv=v);
|
||||
user.setAttributes(vv);
|
||||
}
|
||||
}
|
||||
|
||||
GrantedAuthority[] extraAuthorities = authoritiesPopulator.getGrantedAuthorities(ldapUser);
|
||||
|
||||
Reference in new issue
Block a user