1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-02-21 17:51:18 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Yohann D'ANELLO
1520e78bad
Alias is not properly replaced 2021-01-08 22:41:26 +01:00
2 changed files with 2 additions and 4 deletions

View File

@ -42,7 +42,6 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
for _, username := range potentialUsernames { for _, username := range potentialUsernames {
// Try to bind as user // Try to bind as user
bindDn := "cn=" + username + "," + a.Cfg.UserDn bindDn := "cn=" + username + "," + a.Cfg.UserDn
log.Printf("[LDAP] Logging to %s...", bindDn)
err = a.Conn.Bind(bindDn, password) err = a.Conn.Bind(bindDn, password)
if err == nil { if err == nil {
// Login succeeded if no error // Login succeeded if no error
@ -50,7 +49,6 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
} }
} }
log.Printf("[LDAP] Logging failed: %s", err)
// Unable to log in // Unable to log in
return err == nil, "", err return err == nil, "", err
} }

View File

@ -83,12 +83,12 @@ func Serve(streams *messaging.Streams, authBackend auth.Backend, cfg *Options) {
if authBackend != nil { if authBackend != nil {
// check password // check password
ok, username, err := authBackend.Login(name, password) ok, username, err := authBackend.Login(name, password)
if !ok || err != nil { name = username
if ok || err != nil {
log.Printf("Failed to authenticate for stream %s", name) log.Printf("Failed to authenticate for stream %s", name)
s.Close() s.Close()
continue continue
} }
name = username
} }
go handleStreamer(s, streams, name) go handleStreamer(s, streams, name)