guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjum...@apache.org
Subject [02/10] incubator-guacamole-client git commit: GUACAMOLE-102: Fix issue with string comparison, and fully check values for ldap-dereference-aliases.
Date Tue, 21 Mar 2017 17:47:26 GMT
GUACAMOLE-102: Fix issue with string comparison, and fully check values for ldap-dereference-aliases.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/c0a1b692
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/c0a1b692
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/c0a1b692

Branch: refs/heads/master
Commit: c0a1b692d1151162df87a2a3749e53f27833db14
Parents: 907e0ed
Author: Nick Couchman <nick.couchman@yahoo.com>
Authored: Sun Mar 19 20:45:52 2017 -0400
Committer: Nick Couchman <nick.couchman@yahoo.com>
Committed: Sun Mar 19 20:45:52 2017 -0400

----------------------------------------------------------------------
 .../guacamole/auth/ldap/ConfigurationService.java     | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/c0a1b692/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
index f29d8f1..e546414 100644
--- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
+++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
@@ -241,17 +241,23 @@ public class ConfigurationService {
             "never"
         );
 
-        if (derefAliases == "always")
+        if (derefAliases.equals("always"))
             return 3;
 
-        else if (derefAliases == "finding")
+        else if (derefAliases.equals("finding"))
             return 2;
 
-        else if (derefAliases == "searching")
+        else if (derefAliases.equals("searching"))
             return 1;
 
-        else
+        else if (derefAliases.equals("never"))
             return 0;
+        
+        else {
+            logger.error("Invalid value given for ldap-dereference-aliases.");
+            logger.debug("Received {} but expected one of the following: always, finding,
searching, never.", derefAliases);
+            throw new GuacamoleException("Invalid valid for ldap-dereference-aliases.");
+        }
 
     }
 


Mime
View raw message