mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
Clone identity objects to prevent races. (#15123)
This commit is contained in:
3
changelog/15123.txt
Normal file
3
changelog/15123.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:improvement
|
||||||
|
core: Fix some identity data races found by Go race detector (no known impact yet).
|
||||||
|
```
|
||||||
@@ -786,7 +786,7 @@ func (i *IdentityStore) mergeEntity(ctx context.Context, txn *memdb.Txn, toEntit
|
|||||||
return errors.New("to_entity_id should not be present in from_entity_ids"), nil
|
return errors.New("to_entity_id should not be present in from_entity_ids"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
fromEntity, err := i.MemDBEntityByID(fromEntityID, false)
|
fromEntity, err := i.MemDBEntityByID(fromEntityID, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ func (i *IdentityStore) processLocalAlias(ctx context.Context, lAlias *logical.A
|
|||||||
return nil, fmt.Errorf("mount accessor %q is not local", lAlias.MountAccessor)
|
return nil, fmt.Errorf("mount accessor %q is not local", lAlias.MountAccessor)
|
||||||
}
|
}
|
||||||
|
|
||||||
alias, err := i.MemDBAliasByFactors(lAlias.MountAccessor, lAlias.Name, false, false)
|
alias, err := i.MemDBAliasByFactors(lAlias.MountAccessor, lAlias.Name, true, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user