backport of commit fb7f872b762ebc973066fc8e627312f09620a754 (#25717)
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
This commit is contained in:
parent
7d15950da2
commit
3364c58efb
3
changelog/25697.txt
Normal file
3
changelog/25697.txt
Normal file
@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
core/login: Fixed a potential deadlock when a login fails and user lockout is enabled.
|
||||
```
|
@ -2290,6 +2290,8 @@ func (c *Core) LocalGetUserFailedLoginInfo(ctx context.Context, userKey FailedLo
|
||||
// LocalUpdateUserFailedLoginInfo updates the failed login information for a user based on alias name and mountAccessor
|
||||
func (c *Core) LocalUpdateUserFailedLoginInfo(ctx context.Context, userKey FailedLoginUser, failedLoginInfo *FailedLoginInfo, deleteEntry bool) error {
|
||||
c.userFailedLoginInfoLock.Lock()
|
||||
defer c.userFailedLoginInfoLock.Unlock()
|
||||
|
||||
switch deleteEntry {
|
||||
case false:
|
||||
// update entry in the map
|
||||
@ -2332,7 +2334,6 @@ func (c *Core) LocalUpdateUserFailedLoginInfo(ctx context.Context, userKey Faile
|
||||
// delete the entry from the map, if no key exists it is no-op
|
||||
delete(c.userFailedLoginInfo, userKey)
|
||||
}
|
||||
c.userFailedLoginInfoLock.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user