diff options
author | Alex Auvolat <alex@adnab.me> | 2020-01-28 00:52:30 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-01-28 00:52:30 +0100 |
commit | e1f5c31402df97594116267b4f918582f2496ee0 (patch) | |
tree | cf87b238f6680ea85ffa8d9d6c5107b096ff5056 /main.go | |
parent | 3edaad9317db280db903a18ec85a70e6c32cabf9 (diff) | |
download | bottin-e1f5c31402df97594116267b4f918582f2496ee0.tar.gz bottin-e1f5c31402df97594116267b4f918582f2496ee0.zip |
More logs
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -413,7 +413,7 @@ func (server *Server) handleBind(s ldap.UserState, w ldap.ResponseWriter, m *lda func (server *Server) handleBindInternal(state *State, r *message.BindRequest) (int, error) { // Check permissions if !server.config.Acl.Check(&state.login, "bind", string(r.Name()), []string{}) { - return ldap.LDAPResultInsufficientAccessRights, nil + return ldap.LDAPResultInsufficientAccessRights, fmt.Errorf("Insufficient access rights for %#v", state.login) } // Try to retrieve password and check for match @@ -422,7 +422,7 @@ func (server *Server) handleBindInternal(state *State, r *message.BindRequest) ( return ldap.LDAPResultOperationsError, err } if passwd == nil { - return ldap.LDAPResultNoSuchObject, nil + return ldap.LDAPResultNoSuchObject, fmt.Errorf("%s has no password", string(r.Name())) } for _, hash := range passwd { @@ -439,5 +439,5 @@ func (server *Server) handleBindInternal(state *State, r *message.BindRequest) ( return ldap.LDAPResultSuccess, nil } } - return ldap.LDAPResultInvalidCredentials, nil + return ldap.LDAPResultInvalidCredentials, fmt.Errorf("No password match") } |