This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new 3f8b9f4846 [FIX] LDAP user listing should ignore invalid users (#3003)
3f8b9f4846 is described below
commit 3f8b9f4846dbb4f6ce03206fc46c27a546c307bb
Author: Benoit TELLIER <[email protected]>
AuthorDate: Mon Apr 13 07:27:41 2026 +0200
[FIX] LDAP user listing should ignore invalid users (#3003)
---
.../java/org/apache/james/user/ldap/ReadOnlyLDAPUsersDAO.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyLDAPUsersDAO.java
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyLDAPUsersDAO.java
index 473b862431..d769fc2fc4 100644
---
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyLDAPUsersDAO.java
+++
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyLDAPUsersDAO.java
@@ -205,7 +205,14 @@ public class ReadOnlyLDAPUsersDAO implements UsersDAO,
Configurable {
.flatMap(Throwing.<String, Stream<SearchResultEntry>>function(s ->
entriesFromDN(s, usernameAttribute)).sneakyThrow())
.flatMap(entry ->
Optional.ofNullable(entry.getAttribute(usernameAttribute)).stream())
.map(Attribute::getValue)
- .map(Username::of)
+ .flatMap(name -> {
+ try {
+ return Stream.of(Username.of(name));
+ } catch (Exception e) {
+ LOGGER.warn("Invalid username in the LDAP: {}", name, e);
+ return Stream.empty();
+ }
+ })
.distinct();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]