mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 08:02:19 +00:00
I am an idiot, don't let only people with the *wrong* password stream
This commit is contained in:
parent
79f52ed880
commit
34652f8f3e
@ -45,12 +45,12 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
|
|||||||
log.Printf("[LDAP] Logging to %s...", bindDn)
|
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 {
|
||||||
log.Printf("[LDAP] Logging failed: %s", err)
|
|
||||||
// Login succeeded if no error
|
// Login succeeded if no error
|
||||||
return true, aliasSplit[0], nil
|
return true, aliasSplit[0], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Printf("[LDAP] Logging failed: %s", err)
|
||||||
// Unable to log in
|
// Unable to log in
|
||||||
return err == nil, "", err
|
return err == nil, "", err
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ 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 {
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user