LDAP_CONTROLS(3)
π LDAP_CONTROLS(3) β the control-freak page (affectionate)
okay so bestie, welcome to LDAP_CONTROLS(3), which is a Library Functions Manual page and honestly? it's giving "backstage pass to LDAP controls" β¨ these are the little functions that let you poke at the control structures, and you're gonna slay them.
π NAME π
ldap_control_create, ldap_control_find, ldap_control_dup, ldap_controls_dup, ldap_control_free, ldap_controls_free β the LDAP control manipulation routines π« like, all of them, one happy little family.
π LIBRARY π
OpenLDAP LDAP (libldap, -lldap)
β¨ SYNOPSIS β¨
#include <ldap.h>
int ldap_control_create(const char *oid, int iscritical, struct berval
*value, int dupval, LDAPControl **ctrlp);
LDAPControl *ldap_control_find( const char *oid, LDAPControl **ctrls,
LDAPControl ***nextctrlp);
LDAPControl *ldap_control_dup(LDAPControl *ctrl);
LDAPControl **ldap_controls_dup(LDAPControl **ctrls);
void ldap_control_free(LDAPControl *ctrl);
void ldap_controls_free(LDAPControl **ctrls);
π DESCRIPTION π
okay so these routines are literally the whole vibe for manipulating the structures that LDAP controls live in π«Ά that's it, that's the job.
πΈ ldap_control_create() πΈ
this one creates a control with the OID you give it, using the contents of the value parameter for the control value β if there is one, no pressure π the content of value gets duplicated if dupval is non-zero. and heads up: the iscritical parameter must be non-zero for a critical control π₯
the created control gets returned in the ctrlp parameter, and the routine returns LDAP_SUCCESS on success, or some other error code if it flops π
the content of value, for supported control types, can be prepared using helpers provided by this implementation of libldap β usually in the form ldap_create_<control name>_control_value(). otherwise it can be BER-encoded using the functionalities of liblber. iykyk π§
π¦ ldap_control_find() π¦
searches the NULL-terminated ctrls array for a control whose OID matches the oid parameter π returns a pointer to the control if it's found, NULL otherwise. simple, iconic.
if the nextctrlp parameter is not NULL, then on return it will point to the next control in the array β and you can pass it to ldap_control_find() for subsequent calls, to find further occurrences of the same control type π
β οΈ the use of this function is discouraged. the recommended way of handling controls in responses consists in going through the array of controls, dealing with each of them in the returned order, since it could matter. no cap, order matters π
π ldap_control_dup() and ldap_controls_dup() π
ldap_control_dup() duplicates an individual control structure, and ldap_controls_dup() duplicates a NULL-terminated array of controls π copy paste but make it legal.
π ldap_control_free() and ldap_controls_free() π
ldap_control_free() frees an individual control structure, and ldap_controls_free() frees a NULL-terminated array of controls π«Ά clean up after yourself bestie, the memory will NOT free itself.
π SEE ALSO π
π 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. shoutout to the legends π
and that's the page, bestie π
β¨ signed off by OpenLDAP 2.6.16, dated 2026/10/21, from the LDAP_CONTROLS(3) girlies with love ππ¦π
π¦ 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