-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ldap::addAttributes() fails without throwing if bind() has not been called #2
Comments
@heiglandreas current tests pass because they check that That should never be. Please advise how you'd like to proceed. You've not approved of any changes to existing tests in the past. Originally posted by @mbaynton at zendframework/zend-ldap#75 (comment) |
thanks for noting and raising that issue! And I'd rather see that I'm not yet sure how to handle that test but I'll check that today. Perhaps adding a new test for the fixed (right) behaviour and mark the current test as incomplete or skipped. Originally posted by @heiglandreas at zendframework/zend-ldap#75 (comment) |
Originally posted by @mbaynton at zendframework/zend-ldap#75 (comment) |
This one is bad. Other methods that require an ldap bind to have been made, like
Ldap::search()
, check if the connection is already bound and callLdap::bind()
if not, so users may be accustomed to skipping callingLdap::bind()
directly in user code. However, Ldap::addAttributes() does not do this, so if the Ldap instance doesn't already have a bound connection, we end up callingldap_mod_add()
withnull
as the ldap resource. Obviously, that doesn't work, but worse, ldap_mod_add returnsnull
, notfalse
, when it is given anull
resource, and we only throw an exception if it returnsfalse
. So calling code gets no indication that something is wrong.#68 and #73 as currently written are also subject to this bug.
I'll submit two PRs for this, one with only new tests that cover this case, and one with tests plus fix.
Originally posted by @mbaynton at zendframework/zend-ldap#75
The text was updated successfully, but these errors were encountered: