outpost/ldap: fix panic when attempting to update without locked users mutex

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-18 19:36:27 +01:00
parent ea63d384fd
commit ae9f1c1063
1 changed files with 2 additions and 1 deletions

View File

@ -45,8 +45,9 @@ func (ls *LDAPServer) Refresh() error {
existing := ls.getCurrentProvider(provider.Pk) existing := ls.getCurrentProvider(provider.Pk)
users := make(map[string]flags.UserFlags) users := make(map[string]flags.UserFlags)
if existing != nil { if existing != nil {
existing.boundUsersMutex.Unlock() existing.boundUsersMutex.RLock()
users = existing.boundUsers users = existing.boundUsers
existing.boundUsersMutex.RUnlock()
} }
providers[idx] = &ProviderInstance{ providers[idx] = &ProviderInstance{