Fixed issue #1155 - Group and User filter detection for freeIPA LDAP fails.

This commit is contained in:
Thorsten Eckel 2017-06-01 11:43:19 +02:00
parent 8cef58b4da
commit 118ed9d58b
3 changed files with 3 additions and 2 deletions

View file

@ -137,6 +137,7 @@ class Ldap
result = ldap.get_operation_result
raise Exceptions::UnprocessableEntity, "Can't bind to '#{@host}', #{result.code}, #{result.message}"
rescue => e
Rails.logger.error e
raise Exceptions::UnprocessableEntity, "Can't connect to '#{@host}' on port '#{@port}', #{e}"
end

View file

@ -112,7 +112,7 @@ class Ldap
#
# @return [String, nil] The active or found filter or nil if none could be found.
def filter
@filter ||= lookup_filter(['(objectClass=group)'])
@filter ||= lookup_filter(['(objectClass=group)', '(objectClass=posixgroup)'])
end
# The active uid attribute of the instance. If none give on initialization an automatic lookup is performed.

View file

@ -162,7 +162,7 @@ class Ldap
#
# @return [String, nil] The active or found filter or nil if none could be found.
def filter
@filter ||= lookup_filter(['(&(objectClass=user)(samaccountname=*)(!(samaccountname=*$)))', '(objectClass=user)'])
@filter ||= lookup_filter(['(&(objectClass=user)(samaccountname=*)(!(samaccountname=*$)))', '(objectClass=user)', '(objectClass=posixaccount)'])
end
# The active uid attribute of the instance. If none give on initialization an automatic lookup is performed.