From 64a67422d1925589be3595ed044921820d3b5df0 Mon Sep 17 00:00:00 2001 From: eisin Date: Tue, 25 Dec 2018 01:41:48 +0900 Subject: responds without error if basedn is blank --- src/pamldapd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pamldapd.go b/src/pamldapd.go index 9715ca1..e90b646 100644 --- a/src/pamldapd.go +++ b/src/pamldapd.go @@ -131,6 +131,9 @@ func (b Backend) Search(bindDN string, req ldap.SearchRequest, conn net.Conn) (r return ldap.ServerSearchResult{ResultCode: ldap.LDAPResultOperationsError}, err } } + if req.BaseDN == "" { + return ldap.ServerSearchResult{make([]*ldap.Entry, 0), []string{}, []ldap.Control{}, ldap.LDAPResultSuccess}, nil + } var entry *ldap.Entry if filterObjectClass == "posixaccount" || filterObjectClass == "" { if entry, err = b.makeSearchEntryAccount("cn="+username+","+b.PeopleDN, username); err != nil { -- cgit v1.2.3