Compare commits

...

1 Commits

Author SHA1 Message Date
DacongDA
0ac69bde53 feat: fix objectClass filter will return empty response (#4011) 2025-07-28 23:39:04 +08:00
2 changed files with 3 additions and 4 deletions

View File

@@ -149,10 +149,6 @@ func handleSearch(w ldap.ResponseWriter, m *ldap.Message) {
}
r := m.GetSearchRequest()
if r.FilterString() == "(objectClass=*)" {
w.Write(res)
return
}
// Handle Stop Signal (server stop / client disconnected / Abandoned request....)
select {

View File

@@ -200,6 +200,9 @@ func buildUserFilterCondition(filter interface{}) (builder.Cond, error) {
}
return builder.Eq{field: string(f.AssertionValue())}, nil
case message.FilterPresent:
if strings.EqualFold(string(f), "objectclass") {
return builder.Expr("1 = 1"), nil
}
field, err := getUserFieldFromAttribute(string(f))
if err != nil {
return nil, err