From ae9f1c106373e09a44c064033f2859ea7594f92d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 18 Nov 2021 19:36:27 +0100 Subject: [PATCH] outpost/ldap: fix panic when attempting to update without locked users mutex Signed-off-by: Jens Langhammer --- internal/outpost/ldap/refresh.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/outpost/ldap/refresh.go b/internal/outpost/ldap/refresh.go index a79417b40..dec2fc7d1 100644 --- a/internal/outpost/ldap/refresh.go +++ b/internal/outpost/ldap/refresh.go @@ -45,8 +45,9 @@ func (ls *LDAPServer) Refresh() error { existing := ls.getCurrentProvider(provider.Pk) users := make(map[string]flags.UserFlags) if existing != nil { - existing.boundUsersMutex.Unlock() + existing.boundUsersMutex.RLock() users = existing.boundUsers + existing.boundUsersMutex.RUnlock() } providers[idx] = &ProviderInstance{