LDAP_DELETE(3)

πŸ’… LDAP_DELETE(3) β€” the ldap_delete girlies' guide

okay so bestie, this is the <ldap_delete.h>... no wait, it's LDAP_DELETE(3), a Library Functions Manual page, and it's literally all about Perform an LDAP delete operation ✨ four whole functions that yeet an entry out of your directory. yes ma'am. let's get into it πŸŽ€

πŸ“š LIBRARY

OpenLDAP LDAP (libldap, -lldap) β€” that's the vibe check on where these bad boys live 🫢

✨ SYNOPSIS ✨

#include <ldap.h>

int ldap_delete_s(ld, dn)
LDAP *ld;
char *dn;

int ldap_delete(ld, dn)
LDAP *ld;
char *dn;

int ldap_delete_ext(ld, dn, serverctrls, clientctrls, msgidp)
LDAP *ld;
char *dn;
LDAPControl **serverctrls, **clientctrls;
int *msgidp;

int ldap_delete_ext_s(ld, dn, serverctrls, clientctrls)
LDAP *ld;
char *dn;
LDAPControl **serverctrls, **clientctrls;

no cap, that's four whole signatures. K&R style. vintage. we respect it πŸ’…


🌸 DESCRIPTION 🌸

πŸ’– ldap_delete_s() β€” the patient one

The ldap_delete_s() routine is used to perform an LDAP delete operation synchronously. it takes dn, the DN of the entry to be deleted (yes, that's the one you're sending to the shadow realm πŸ¦‹). it returns an LDAP error code, indicating the success or failure of the operation. simple. iconic. it waits for you like a good bestie.

πŸ’œ ldap_delete() β€” the main character

The ldap_delete() routine is used to perform an LDAP delete operation asynchronously. she takes the same parameters as ldap_delete_s(), but returns the message id of the request she initiated πŸ”₯ and the result of the delete can be obtained by a subsequent call to ldap_result(3). so you gotta follow up. she's not gonna text you first, bestie.

πŸ¦‹ ldap_delete_ext() β€” the fancy one with accessories

The ldap_delete_ext() routine allows server and client controls to be specified to extend the delete request. yes, controls. the little extras. the it's giving customization ✨ this routine is asynchronous like ldap_delete(), but its return value is an LDAP error code. it stores the message id of the request in the integer pointed to by msgidp. so you get the error code and the id. two for one. we love to see it.

πŸŽ€ ldap_delete_ext_s() β€” the fancy one but chill

The ldap_delete_ext_s() routine is the synchronous version of ldap_delete_ext(). it also returns an LDAP error code indicating success or failure of the operation. controls + waiting = her whole personality πŸ’…


πŸ’€ ERRORS πŸ’€

  • ldap_delete_s() returns an LDAP error code which can be interpreted by calling one of ldap_perror(3) and friends πŸ‘―β€β™€οΈ
  • ldap_delete() returns -1 if something went wrong initiating the request. it returns the non-negative message id of the request if things went ok.
  • ldap_delete_ext() and ldap_delete_ext_s() return some Non-zero value if something went wrong initiating the request, else return 0.
⚠️ okay so read those return values carefully bestie β€” ldap_delete() returning -1 is the "oops" signal, but a non-negative return is your message id, not a status. don't be out here treating everything as success/fail 😭 and for the _ext pair, non-zero means the initiating went wrong, 0 means it went fine. that's it. that's the whole assignment.

🫢 SEE ALSO 🫢

go read those next, 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.


and that's the tea, bestie πŸ“βœ¨ this whole page is brought to you by OpenLDAP 2.6.16, dated 2026/10/21 β€” LDAP_DELETE(3), logged off, deleted, periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from