You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2009/12/23 09:49:14 UTC
svn commit: r893429 -
/geronimo/server/branches/2.1/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
Author: xuhaihong
Date: Wed Dec 23 08:49:14 2009
New Revision: 893429
URL: http://svn.apache.org/viewvc?rev=893429&view=rev
Log:
GERONIMO-4997 Can not connect to a ldap server in an anonymous way
Modified:
geronimo/server/branches/2.1/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
Modified: geronimo/server/branches/2.1/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java?rev=893429&r1=893428&r2=893429&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java Wed Dec 23 08:49:14 2009
@@ -448,10 +448,10 @@
try {
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
- if (connectionUsername != null || !"".equals(connectionUsername)) {
+ if (connectionUsername != null && connectionUsername.length() > 0) {
env.put(Context.SECURITY_PRINCIPAL, connectionUsername);
}
- if (connectionPassword != null || !"".equals(connectionPassword)) {
+ if (connectionPassword != null && connectionPassword.length() > 0) {
env.put(Context.SECURITY_CREDENTIALS, connectionPassword);
}
env.put(Context.SECURITY_PROTOCOL, connectionProtocol == null ? "" : connectionProtocol);