[Date Prev][Date Next] [Chronological] [Thread] [Top]

ldap_rename() (Was: ldap_remove()) in ldapext-ldap-c-api-01



Mark Wahl wrote:
> I assume you mean ldap_rename, not ldap_remove?

Yes, my mistake....  I was amazing consistent. :-)

I've attached an admended version of my comments.

> ldap_modrdn() and ldap_modrdn_s() in RFC 1823 appear to be very
> similar to what you describe.  Unfortunately, U-M LDAP 3.3 and
> RFC 1823 are in conflict: U-M LDAP did not have the
> deleteoldrdn parameter to ldap_modrdn or ldap_modrdn_s.  Because
> the majority of v2 clients using that implementation coded to the header
> and not to the RFC, we deprecated this API and created a new API that
> would not have this confusion.

I agree that ldap_modrdn/modrdn_s should be depreciated.
My recommendation was concerning the new API.
I believe the new API should have four functions instead of two.

        ldap_rename()           /* without controls */
        ldap_rename_s()         /* without controls */
        ldap_rename_ext()       /* with controls */
        ldap_rename_ext_s()     /* with controls */

This would make ldap_rename*() consistent with other ldap operation
APIs and reduce application programmer confusion.  Implementation
overhead would be minimal.


--- Admended comment --

ldap_rename*() do not provide an interface consistent
with other ldap routines, such as ldap_search*(),
ldap_copy*(), ldap_modify*(), and ldap_delete*().
For the other operations, ldap_op()/ldap_op_s() preforms
a simple operation and ldap_op_ext()/ldap_op_ext_s()
operations that require extended parameters.  For rename,
however, ldap_rename/ldap_rename_s expect "extended"
parameters and there are no simple interface versions.

I believe application programmers should be provided
with both simple and extended versions of every ldap
operation AND that these be named consistently.  I
recommend that:

  ldap_rename() be renamed ldap_rename_ext()
  ldap_rename_s() be renamed ldap_rename_ext_s()

And two new functions be added:
  int ldap_rename(LDAP *ld,
        char* dn,
        char* newrdn,
        *newparent,
        int deleteoldrdn);
  int ldap_rename_s(LDAP *ld,
        char* dn,
        char* newrdn,
        *newparent,
        int deleteoldrdn);

In terms of implementation, this change has very little impact.
However, application developers will enjoy better consistency
of interface.