pear / Net_LDAP2

Object oriented interface for searching and manipulating LDAP-entries
http://pear.php.net/package/Net_LDAP2
GNU Lesser General Public License v3.0
10 stars 6 forks source link

Net_LDAP2_Entry::update(): do not submit empty modification #10

Open brenard opened 1 year ago

brenard commented 1 year ago

Fix #9

cweiske commented 1 year ago

Please add a unit test that shows that this bug existed.

Neustradamus commented 11 months ago

@brenard: Have you seen the @cweiske comment?

brenard commented 11 months ago

@brenard: Have you seen the @cweiske comment?

Yes, I seen. The problem is, like exposed in the issue, this bug occurred only in not common case : I discovered it when using the constraint overlay with a constraint on an attribute used as some objects RDN. To make a test case that demonstrated this bug, I have to change the OpenLDAP server used during tests, but it's an external server, not controlled by the test process. How I can do that ?

If you look my patch, you will see I just verify the $modifications array is not empty before trying to apply these modifications. I don't think there is a situation in which this could be a problem, it's just avoid an empty modification request to the LDAP server. By fixing this issue, I also just remove a useless request.