From fc5c4c538e97d028bdd1c79dc0e553f99e46f21a Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Sat, 15 Dec 2018 14:11:53 -0500 Subject: [PATCH] GUACAMOLE-234: Don't close the connection after bind. --- .../apache/guacamole/auth/ldap/LDAPConnectionService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java index 744936d31..a5ee4b3c5 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java @@ -156,14 +156,12 @@ public class LDAPConnectionService { // Disconnect if an error occurs during bind catch (LdapException e) { logger.debug("Unable to bind to LDAP server.", e); + disconnect(ldapConnection); throw new GuacamoleInvalidCredentialsException( "Unable to bind to the LDAP server.", CredentialsInfo.USERNAME_PASSWORD); } - finally { - disconnect(ldapConnection); - } - + return ldapConnection; }