mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 21:56:19 +10:00
Check for errors in Adapter#dn_matches_filter?
This commit is contained in:
@@ -107,7 +107,12 @@ module Gitlab
|
||||
end
|
||||
|
||||
def dn_matches_filter?(dn, filter)
|
||||
ldap.search(base: dn, filter: filter, attributes: %w{dn}).any?
|
||||
results = ldap.search(base: dn, filter: filter, attributes: %w{dn})
|
||||
if results.nil?
|
||||
false # Net::LDAP encountered an LDAP error
|
||||
else
|
||||
results.any?
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user