diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-13 13:53:35 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-13 14:41:49 +0100 |
commit | 6f893138a3b593e6918c3dc1bd04d12f01d6c4a5 (patch) | |
tree | 0ce0200994f10e216a4d05251fe1074837f2d66d /main.go | |
parent | 851573e28f73102dedc6b9aca04f5f3248bdc9f4 (diff) | |
download | bottin-6f893138a3b593e6918c3dc1bd04d12f01d6c4a5.tar.gz bottin-6f893138a3b593e6918c3dc1bd04d12f01d6c4a5.zip |
Make getAttribute return an empty array instead of nil when key not found
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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())) |