aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index d665caf..174bde6 100644
--- a/main.go
+++ b/main.go
@@ -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")
}