karpet/net-ldap-server-test — pull request #2 by rporres (2012-10-25 10:36:05+00:00)
Title: ModifyDN fixes

I've added some code to handle the case in which newSuperior attribute doesn't come from decoded content. If it doesn't come we still need the base DN to move the rdn to otherwise we would move it to the root of the tree. This is better understood with an example:

$ldap->moddn('msisdn=34678001122,app=test', newrdn => 'msisdn=34999000111');

If there's no newsuperior attribute, what we are doing is renaming the object from

'msisdn=34678001122,app=test'

to

'msisdn=34999000111,app=test'

The code as it was, was moving it to a different place in the directory tree 'msisdn=34999000111'

As the code is working now, I've also patched the tests to make sure they are ok.

In any case, I feel that the code shouldn't be necessary. moddn operation in Net::LDAP always adds newSuperior attribute. Hence, I don't understand why I needed to add code to handle the case in which it is not defined...