From ed6659a46d6fef8131897c40daca46890c1db776 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 8 Nov 2021 14:41:38 +0100 Subject: [PATCH] outpost/ldap: don't cleanup user info as it is overwritten on bind closes #1651 Signed-off-by: Jens Langhammer --- internal/outpost/ldap/close.go | 32 -------------------------------- internal/outpost/ldap/ldap.go | 1 - 2 files changed, 33 deletions(-) delete mode 100644 internal/outpost/ldap/close.go diff --git a/internal/outpost/ldap/close.go b/internal/outpost/ldap/close.go deleted file mode 100644 index 7fc8989cd..000000000 --- a/internal/outpost/ldap/close.go +++ /dev/null @@ -1,32 +0,0 @@ -package ldap - -import ( - "net" - "time" -) - -func (ls *LDAPServer) Close(boundDN string, conn net.Conn) error { - for _, p := range ls.providers { - p.delayDeleteUserInfo(boundDN) - } - return nil -} - -func (pi *ProviderInstance) delayDeleteUserInfo(dn string) { - ticker := time.NewTicker(30 * time.Second) - quit := make(chan struct{}) - go func() { - for { - select { - case <-ticker.C: - pi.boundUsersMutex.Lock() - delete(pi.boundUsers, dn) - pi.boundUsersMutex.Unlock() - close(quit) - case <-quit: - ticker.Stop() - return - } - } - }() -} diff --git a/internal/outpost/ldap/ldap.go b/internal/outpost/ldap/ldap.go index 96d2df84d..b37dc1893 100644 --- a/internal/outpost/ldap/ldap.go +++ b/internal/outpost/ldap/ldap.go @@ -40,7 +40,6 @@ func NewServer(ac *ak.APIController) *LDAPServer { ls.defaultCert = &defaultCert s.BindFunc("", ls) s.SearchFunc("", ls) - s.CloseFunc("", ls) return ls }