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:51:02 UTC
svn commit: r893431 -
/geronimo/server/branches/2.2/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
Author: xuhaihong
Date: Wed Dec 23 08:51:02 2009
New Revision: 893431
URL: http://svn.apache.org/viewvc?rev=893431&view=rev
Log:
GERONIMO-4997 Can not connect to a ldap server in an anonymous way
Modified:
geronimo/server/branches/2.2/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
Modified: geronimo/server/branches/2.2/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.2/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java?rev=893431&r1=893430&r2=893431&view=diff
==============================================================================
--- geronimo/server/branches/2.2/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java (original)
+++ geronimo/server/branches/2.2/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java Wed Dec 23 08:51:02 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);