aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go5
-rw-r--r--write.go9
2 files changed, 1 insertions, 13 deletions
diff --git a/main.go b/main.go
index 381c3b5..5e9811d 100644
--- a/main.go
+++ b/main.go
@@ -359,7 +359,7 @@ func (server *Server) getAttribute(dn string, attr string) ([]string, error) {
}
if pair == nil {
- return nil, nil
+ return []string{}, nil
}
return parseValue(pair.Value)
@@ -448,9 +448,6 @@ func (server *Server) handleBindInternal(state *State, r *message.BindRequest) (
if err != nil {
return ldap.LDAPResultOperationsError, err
}
- if passwd == nil {
- return ldap.LDAPResultNoSuchObject, fmt.Errorf("%s has no password", string(r.Name()))
- }
for _, hash := range passwd {
valid := SSHAMatches(hash, []byte(r.AuthenticationSimple()))
diff --git a/write.go b/write.go
index 2c35309..57c642c 100644
--- a/write.go
+++ b/write.go
@@ -118,9 +118,6 @@ func (server *Server) handleAddInternal(state *State, r *message.AddRequest) (in
server.logger.Warnf("Could not add %s to memberOf of %s: %s", dn, member, err)
continue
}
- if memberGroups == nil {
- memberGroups = []string{}
- }
alreadyMember := false
for _, mb := range memberGroups {
@@ -473,9 +470,6 @@ func (server *Server) handleModifyInternal(state *State, r *message.ModifyReques
server.logger.Warnf("Could not add %s to memberOf of %s: %s", dn, addMem, err)
continue
}
- if memberOf == nil {
- memberOf = []string{}
- }
alreadyMember := false
for _, mb := range memberOf {
@@ -501,9 +495,6 @@ func (server *Server) handleModifyInternal(state *State, r *message.ModifyReques
server.logger.Warnf("Could not remove %s from memberOf of %s: %s", dn, delMem, err)
continue
}
- if memberOf == nil {
- memberOf = []string{}
- }
newMemberOf := []string{}
for _, g := range memberOf {
if g != dn {