LDAP_RENAME(3)
π LDAP_RENAME β bestie edition π
okay so this is ldap_rename(3) and ldap_rename_s(3) from the OpenLDAP LDAP library, aka libldap, link it with -lldap and you're slaying β¨
β¨ NAME β¨
ldap_rename, ldap_rename_s β literally renames the entry you point at. iconic behavior, no cap π
πΈ LIBRARY πΈ
OpenLDAP LDAP (libldap, -lldap) β that's your girl π«Ά
π¦ SYNOPSIS π¦
#include <ldap.h>
int ldap_rename( ld, dn, newrdn, newparent, deleteoldrdn, sctrls[], cctrls[], msgidp );
LDAP *ld;
const char *dn, *newrdn, *newparent;
int deleteoldrdn;
LDAPControl *sctrls[], *cctrls[];
int *msgidp);
int ldap_rename_s( ld, dn, newrdn, newparent, deleteoldrdn, sctrls[], cctrls[] );
LDAP *ld;
const char *dn, *newrdn, *newparent;
int deleteoldrdn;
LDAPControl *sctrls[], *cctrls[];
(yes bestie, that stray ) on msgidp is really in there, we don't touch the source, we respect the source π)
π₯ DESCRIPTION π₯
so these routines do the actual LDAP rename operation, and honestly? it's giving main character energy π
the function changes the leaf component of an entry's distinguished name, and optionally moves the whole entry over to a new parent container. like moving out of your mom's house but, y'know, in LDAP π§³
ldap_rename_s performs a rename operation synchronously β she waits, she commits, she's dependable π
the method takes dn, which points to the distinguished name of the entry whose attribute is being compared. then there's newparent, the distinguished name of the entry's new parent π
- if
newparentisNULL, then only the RDN changes β nothing gets relocated, we're just doing a little rebrand β¨ - the root DN is specified by passing a zero length string,
""π
deleteoldrdn specifies whether the old RDN should be retained or deleted:
- Zero indicates that the old RDN should be retained. if you choose this option, the attribute will contain both names (the old and the new) β lowkey hoarding but valid π«Ά
- Non-zero indicates that the old RDN should be deleted. out with the old, periodt π
serverctrls points to an array of LDAPControl structures that list the client controls to use with this extended operation. use NULL to specify no client controls π
clientctrls points to an array of LDAPControl structures that list the client controls to use with the search π¦
ngl, the sync version is the one you call when you're not trying to do five things at once. but the async one is right there too π
ldap_rename works just like ldap_rename_s, but the operation is asynchronous β she's off doing her own thing, you don't wait around. it returns the message id of the request it initiated, and the result of this operation can be obtained by calling ldap_result(3) β
π ERRORS π
ldap_rename()returns-1in case of error initiating the request, and will set theld_errnofield in theldparameter to indicate the error. not the vibe, but at least she tells you πldap_rename_s()returns the LDAP error code resulting from the rename operation. straightforward, respectful, we stan π
π SEE ALSO π
read those too bestie, iykyk π
π ACKNOWLEDGEMENTS π
OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from the University of Michigan LDAP 3.3 Release. give them their flowers fr fr π
OpenLDAP 2.6.16 Β· 2026/10/21 β that's the version and date, and that's the whole page, mwah πβ¨ go rename something and slay π
π¦ where this page comes from
- fedora 44: openldap-devel 2.6.16-1.fc44 Β· OLDAP-2.8
- fedora 44: openldap-devel 2.6.16-1.fc44 Β· OLDAP-2.8
- Copyright 1998-2026 The OpenLDAP Foundation All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms