From 34652f8f3e37863d923fc59d4a7d905c2f5f5284 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 8 Jan 2021 23:05:01 +0100 Subject: [PATCH] I am an idiot, don't let only people with the *wrong* password stream --- auth/ldap/ldap.go | 2 +- stream/srt/srt.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/ldap/ldap.go b/auth/ldap/ldap.go index ece1761..1495af6 100644 --- a/auth/ldap/ldap.go +++ b/auth/ldap/ldap.go @@ -45,12 +45,12 @@ func (a LDAP) Login(username string, password string) (bool, string, error) { log.Printf("[LDAP] Logging to %s...", bindDn) err = a.Conn.Bind(bindDn, password) if err == nil { - log.Printf("[LDAP] Logging failed: %s", err) // Login succeeded if no error return true, aliasSplit[0], nil } } + log.Printf("[LDAP] Logging failed: %s", err) // Unable to log in return err == nil, "", err } diff --git a/stream/srt/srt.go b/stream/srt/srt.go index 09a69ae..e821ec5 100644 --- a/stream/srt/srt.go +++ b/stream/srt/srt.go @@ -83,7 +83,7 @@ func Serve(streams *messaging.Streams, authBackend auth.Backend, cfg *Options) { if authBackend != nil { // check password ok, username, err := authBackend.Login(name, password) - if ok || err != nil { + if !ok || err != nil { log.Printf("Failed to authenticate for stream %s", name) s.Close() continue