Browse Source

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

Thorsten Eckel 7 years ago
parent
commit
118ed9d58b
3 changed files with 3 additions and 2 deletions
  1. 1 0
      lib/ldap.rb
  2. 1 1
      lib/ldap/group.rb
  3. 1 1
      lib/ldap/user.rb

+ 1 - 0
lib/ldap.rb

@@ -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
 

+ 1 - 1
lib/ldap/group.rb

@@ -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.

+ 1 - 1
lib/ldap/user.rb

@@ -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.