Skip to content

Commit

Permalink
Bug 1806876: limit number of ldap entries based on its capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
soltysh committed Feb 26, 2020
1 parent 952ac5a commit e2ade98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/security/ldapquery/query.go
Expand Up @@ -205,7 +205,11 @@ func formatResult(results []*ldap.Entry) string {
for _, entry := range results {
names = append(names, entry.DN)
}
return "\t" + strings.Join(names[0:10], "\n\t")
len := len(names)
if len > 10 {
len = 10
}
return "\t" + strings.Join(names[0:len], "\n\t")
}

// QueryForEntries queries for LDAP with the given searchRequest
Expand Down

0 comments on commit e2ade98

Please sign in to comment.