Skip to content

Commit b268cf3

Browse files
committed
demonstrates Net::LDAP#open does not expose bind results
we identified that clients cannot safely rely on Net::LDAP#get_operation_result when using Net::LDAP#open because @Result is not set. As a consequence,clients calling Net::LDAP#get_operation_result would get the previous last cached result @Result.
1 parent 9daa954 commit b268cf3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/integration/test_return_codes.rb

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
# See: section 12.12 http://www.openldap.org/doc/admin24/overlays.html
55

66
class TestReturnCodeIntegration < LDAPIntegrationTestCase
7+
def test_open_error
8+
@ldap.authenticate "fake", "creds"
9+
@ldap.open do
10+
result = @ldap.get_operation_result
11+
assert_equal Net::LDAP::ResultCodeInvalidCredentials, result.code
12+
end
13+
end
14+
715
def test_operations_error
816
refute @ldap.search(filter: "cn=operationsError", base: "ou=Retcodes,dc=rubyldap,dc=com")
917
assert result = @ldap.get_operation_result

0 commit comments

Comments
 (0)