From 3f06c51379b9f116c762b87b95f67ca145872485 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Sun, 16 Apr 2006 15:37:48 +0000 Subject: [PATCH] Fix for SEC-225. Allow empty search base in authorities populator. --- .../ldap/populator/DefaultLdapAuthoritiesPopulator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/acegisecurity/providers/ldap/populator/DefaultLdapAuthoritiesPopulator.java b/core/src/main/java/org/acegisecurity/providers/ldap/populator/DefaultLdapAuthoritiesPopulator.java index fd8ae38dce..8aede4dc82 100644 --- a/core/src/main/java/org/acegisecurity/providers/ldap/populator/DefaultLdapAuthoritiesPopulator.java +++ b/core/src/main/java/org/acegisecurity/providers/ldap/populator/DefaultLdapAuthoritiesPopulator.java @@ -161,9 +161,14 @@ public class DefaultLdapAuthoritiesPopulator implements LdapAuthoritiesPopulator */ public DefaultLdapAuthoritiesPopulator(InitialDirContextFactory initialDirContextFactory, String groupSearchBase) { Assert.notNull(initialDirContextFactory, "InitialDirContextFactory must not be null"); - Assert.hasLength(groupSearchBase, "The groupSearchBase (name to search under), must be specified."); + Assert.notNull(groupSearchBase, "The groupSearchBase (name to search under), must not be null."); this.initialDirContextFactory = initialDirContextFactory; this.groupSearchBase = groupSearchBase; + + if(groupSearchBase.length() == 0) { + logger.info("groupSearchBase is empty. Searches will be performed from the root: " + + initialDirContextFactory.getRootDn()); + } } //~ Methods ================================================================