Project

General

Profile

Actions

Bug #20069

open

Validate BaseDN in AuthSourceLDAP before saving

Added by Daniel Lobato Garcia almost 7 years ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1441527

Description of problem:
When the LDAP Group base DN is set, it may happen that there is no group associated with the user, or the DN might be set wrong and the result is same -> no associated group found. This is correct and expected behavior, but, satellite doesn't react properly in a sense, that it generates error 500 with source back trace.

Version-Release number of selected component (if applicable):
6.2

How reproducible:
Add LDAP authentication and set Group base DN to something semantically incorrect, save, and try to login with some LDAP user.

Actual results:
Back trace with Error 500

Expected results:
1) DISPUTABLE Allow login when there is no User group associated - aka behave the same way like the Group base DN have had been empty.

2) Block all login attempts with proper message that no group was found. Perhaps with additional information in the logs what filter was used without a need of turning on LDAP debug mode.

Additional info:
The actual error is in ldap fluff module where there is not being check if the search result is not nil

NoMethodError
undefined method `each' for nil:NilClass
/opt/theforeman/tfm/root/usr/share/gems/gems/ldap_fluff-0.4.5/lib/ldap_fluff/posix_member_service.rb:22:in `find_user_groups'
.
.
.

~~
21: @ldap.search(:filter => Net::LDAP::Filter.eq('memberuid', uid),
22: :base => @group_base).each do |entry|
~~

No data to display

Actions

Also available in: Atom PDF