mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-586: Fix potential NullPointerExceptions in basic and LDAP auth.
This commit is contained in:
@@ -35,6 +35,7 @@ import net.sourceforge.guacamole.net.auth.ldap.LDAPAuthenticationProvider;
|
|||||||
import org.glyptodon.guacamole.auth.ldap.ConfigurationService;
|
import org.glyptodon.guacamole.auth.ldap.ConfigurationService;
|
||||||
import org.glyptodon.guacamole.auth.ldap.EscapingService;
|
import org.glyptodon.guacamole.auth.ldap.EscapingService;
|
||||||
import org.glyptodon.guacamole.GuacamoleException;
|
import org.glyptodon.guacamole.GuacamoleException;
|
||||||
|
import org.glyptodon.guacamole.GuacamoleSecurityException;
|
||||||
import org.glyptodon.guacamole.GuacamoleServerException;
|
import org.glyptodon.guacamole.GuacamoleServerException;
|
||||||
import org.glyptodon.guacamole.net.auth.Connection;
|
import org.glyptodon.guacamole.net.auth.Connection;
|
||||||
import org.glyptodon.guacamole.net.auth.simple.SimpleConnection;
|
import org.glyptodon.guacamole.net.auth.simple.SimpleConnection;
|
||||||
@@ -91,6 +92,11 @@ public class ConnectionService {
|
|||||||
// Pull the current user DN from the LDAP connection
|
// Pull the current user DN from the LDAP connection
|
||||||
String userDN = ldapConnection.getAuthenticationDN();
|
String userDN = ldapConnection.getAuthenticationDN();
|
||||||
|
|
||||||
|
// getConnections() will only be called after a connection has been
|
||||||
|
// authenticated (via non-anonymous bind), thus userDN cannot
|
||||||
|
// possibly be null
|
||||||
|
assert(userDN != null);
|
||||||
|
|
||||||
// Find all Guacamole connections for the given user
|
// Find all Guacamole connections for the given user
|
||||||
LDAPSearchResults results = ldapConnection.search(
|
LDAPSearchResults results = ldapConnection.search(
|
||||||
confService.getConfigurationBaseDN(),
|
confService.getConfigurationBaseDN(),
|
||||||
|
@@ -206,7 +206,7 @@ public class BasicFileAuthenticationProvider extends SimpleAuthenticationProvide
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Validate and return info for given user and pass
|
// Validate and return info for given user and pass
|
||||||
Authorization auth = getUserMapping().getAuthorization(credentials.getUsername());
|
Authorization auth = userMapping.getAuthorization(credentials.getUsername());
|
||||||
if (auth != null && auth.validate(credentials.getUsername(), credentials.getPassword()))
|
if (auth != null && auth.validate(credentials.getUsername(), credentials.getPassword()))
|
||||||
return auth.getConfigurations();
|
return auth.getConfigurations();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user