Skip to content

Commit

Permalink
GUACAMOLE-893: Fix regression in LDAP causing null filter value to be…
Browse files Browse the repository at this point in the history
… sent.
  • Loading branch information
necouchman committed Oct 9, 2019
1 parent 981adc9 commit 10b3adc
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,21 @@ public ExprNode generateQuery(ExprNode filter,
AndNode searchFilter = new AndNode();
searchFilter.addNode(filter);

// Include all attributes within OR clause if there are more than one
// If no attributes provided, we're done.
if (attributes.size() < 1)
return searchFilter;

// Include all attributes within OR clause
OrNode attributeFilter = new OrNode();

// Add equality comparison for each possible attribute
attributes.forEach(attribute ->
attributeFilter.addNode(new EqualityNode(attribute, attributeValue))
attributeFilter.addNode(new EqualityNode(attribute,
(attributeValue != null ? attributeValue : "*")))
);

searchFilter.addNode(attributeFilter);

return searchFilter;

}
Expand Down

0 comments on commit 10b3adc

Please sign in to comment.