diff options
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") } |