LDAP_URL(3)
β¨ NAME β¨
okay so bestie, this is the LDAP_URL(3) page from the Library Functions Manual β and it's literally all about the LDAP Uniform Resource Locator routines π β¨
we're talking ldap_is_ldap_url, ldap_url_parse, and ldap_free_urldesc β no cap, these are the main characters.
π«Ά LIBRARY π«Ά
this whole vibe comes from OpenLDAP LDAP (libldap, -lldap) β periodt.
π SYNOPSIS π
#include <ldap.h>
int ldap_is_ldap_url( const char *url )
int ldap_url_parse( const char *url, LDAPURLDesc **ludpp )
typedef struct ldap_url_desc {
char * lud_scheme; /* URI scheme */
char * lud_host; /* LDAP host to contact */
int lud_port; /* port on host */
char * lud_dn; /* base for search */
char ** lud_attrs; /* list of attributes */
int lud_scope; /* a LDAP_SCOPE_... value */
char * lud_filter; /* LDAP search filter */
char ** lud_exts; /* LDAP extensions */
int lud_crit_exts; /* true if any extension is critical */
/* may contain additional fields for internal use */
} LDAPURLDesc;
void ldap_free_urldesc( LDAPURLDesc *ludp );
πΈ DESCRIPTION πΈ
these routines support the use of LDAP URLs (Uniform Resource Locators) as detailed in RFC 4516 β iykyk.
LDAP URLs look like this:
ldap://hostport/dn[?attrs[?scope[?filter[?exts]]]]
where:
hostportis a host name with an optional":portnumber"dnis the search baseattrsis a comma separated list of attributes to requestscopeis one of these three strings:base one sub (default=base)filteris filterextsare recognized set of LDAP and/or API extensions.
Example: ldap://ldap.example.net/dc=example,dc=net?cn,sn?sub?(cn=*)
URLs that are wrapped in angle-brackets and/or preceded by "URL:" are also tolerated. Alternative LDAP schemes such as ldaps:// and ldapi:// may be parsed using the below routines as well.
ldap_is_ldap_url() is your quick vibe check β it returns a non-zero value if url looks like an LDAP URL (as opposed to some other kind of URL). It's perfect for a fast check, but if you need a more thorough check, use ldap_url_parse() instead β fr fr.
ldap_url_parse() is the main character β it breaks down an LDAP URL passed in url into its component pieces. If successful, zero is returned, an LDAP URL description is allocated, filled in, and ludpp is set to point to it. If an error occurs, a non-zero URL error code is returned β so watch out for that π.
and bestie, don't forget to callldap_free_urldesc()to free an LDAP URL description that you got from a call toldap_url_parse()β no leaks, okay? π«Ά
π¦ SEE ALSO π¦
check out ldap(3) and also RFC 4516 at http://www.rfc-editor.org/rfc/rfc4516.txt β it's giving essential reading π.
π 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. so much love to the OpenLDAP Project and the University of Michigan LDAP 3.3 Release β iconic behaviour only. π
and that's the tea β β this page is from OpenLDAP 2.6.16, dated 2026/10/21, and it's the LDAP_URL(3) manual page. 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