mirror of
https://github.com/redmine/redmine.git
synced 2026-01-26 17:30:00 +01:00
Merge r24366 from trunk to 6.0-stable (#43692).
git-svn-id: https://svn.redmine.org/redmine/branches/6.0-stable@24371 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -228,7 +228,7 @@ class AuthSourceLdap < AuthSource
|
||||
ldap_con = initialize_ldap_con(self.account, self.account_password)
|
||||
end
|
||||
attrs = {}
|
||||
search_filter = base_filter & Net::LDAP::Filter.eq(self.attr_login, login)
|
||||
search_filter = base_filter & Net::LDAP::Filter.equals(self.attr_login, login)
|
||||
ldap_con.search(:base => self.base_dn,
|
||||
:filter => search_filter,
|
||||
:attributes=> search_attributes) do |entry|
|
||||
|
||||
@@ -161,6 +161,13 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
|
||||
assert_nil auth.authenticate('edavis', '123456')
|
||||
end
|
||||
|
||||
test '#authenticate with special characters in login should not allow filter manipulation' do
|
||||
auth = AuthSourceLdap.find(1)
|
||||
|
||||
result = auth.authenticate("*", "123456")
|
||||
assert_nil result
|
||||
end
|
||||
|
||||
def test_authenticate_should_timeout
|
||||
auth_source = AuthSourceLdap.find(1)
|
||||
auth_source.timeout = 1
|
||||
|
||||
Reference in New Issue
Block a user