LDAP_ERROR(3)
π LDAP_ERROR(3) β the error-handling glow-up π
okay bestie, welcome to LDAP_ERROR(3) from the Library Functions Manual β this is the page that tells you what all those cryptic LDAP error numbers are actually saying to you. Let's get into it π«Ά
β¨ NAME β¨
ldap_perror, ld_errno, ldap_result2error, ldap_errlist, ldap_err2string β the LDAP protocol error handling routines. yes, all of them. one page. iconic behavior honestly.
π LIBRARY π
OpenLDAP LDAP β that's libldap, link it with -lldap and you're so back.
π¦ SYNOPSIS π¦
#include <ldap.h>
char *ldap_err2string( int err );
that's it. one function in the synopsis. she's lowkey minimal and i respect it.
πΈ DESCRIPTION πΈ
so ldap_err2string() gives you a short description of the various codes that routines in this library hand back to you. like a little translator bestie for your error codes π
the string it returns is a pointer to a static area β so do not modify it, okay? hands off. she's not yours.
these codes are either:
- negative β meaning it's an API error code,
- positive β meaning it's an LDAP
resultCodethat isn'tsuccess(0), or - zero β meaning both that the API call was successful and the LDAP
resultCodeissuccess(0). double slay.
the code associated with an LDAP session is accessible using ldap_get_option(3) and ldap_set_option(3) with the LDAP_OPT_RESULT_CODE option (previously called LDAP_OPT_ERROR_NUMBER). vintage name, still cute π
π₯ PROTOCOL RESULT CODES π₯
heads up: this section is a partial list of protocol codes recognized by the library. because LDAP is extensible, additional values may be returned β so don't come for her when you see a code that isn't here π a complete listing of registered LDAP result codes can be obtained from the Internet Assigned Numbers Authority <http://www.iana.org>.
LDAP_SUCCESSβ the request was successful. we love a win πLDAP_OPERATIONS_ERRORβ an operations error occurred. mysterious. vague. she contains multitudes.LDAP_PROTOCOL_ERRORβ a protocol violation was detected. rude!LDAP_TIMELIMIT_EXCEEDEDβ an LDAP time limit was exceeded. time's up bestie β°LDAP_SIZELIMIT_EXCEEDEDβ an LDAP size limit was exceeded. too much of a good thing nglLDAP_COMPARE_FALSEβ a compare operation returned false.LDAP_COMPARE_TRUEβ a compare operation returned true.LDAP_STRONG_AUTH_NOT_SUPPORTEDβ the LDAP server does not support strong authentication. it's giving "we don't do that here"LDAP_STRONG_AUTH_REQUIREDβ strong authentication is required for the operation.LDAP_PARTIAL_RESULTSβ partial results only returned.LDAP_NO_SUCH_ATTRIBUTEβ the attribute type specified does not exist in the entry. gone. never was. πLDAP_UNDEFINED_TYPEβ the attribute type specified is invalid.LDAP_INAPPROPRIATE_MATCHINGβ filter type not supported for the specified attribute.LDAP_CONSTRAINT_VIOLATIONβ an attribute value specified violates some constraint (e.g., apostalAddresshas too many lines, or a line that is too long). ma'am, that's too much address.LDAP_TYPE_OR_VALUE_EXISTSβ an attribute type or attribute value specified already exists in the entry.LDAP_INVALID_SYNTAXβ an invalid attribute value was specified.LDAP_NO_SUCH_OBJECTβ the specified object does not exist in The Directory. capital-T capital-D The Directory, she's official.LDAP_ALIAS_PROBLEMβ an alias in The Directory points to a nonexistent entry.LDAP_INVALID_DN_SYNTAXβ a syntactically invalid DN was specified.LDAP_IS_LEAFβ the object specified is a leaf. π a literal leaf.LDAP_ALIAS_DEREF_PROBLEMβ a problem was encountered when dereferencing an alias.LDAP_INAPPROPRIATE_AUTHβ inappropriate authentication was specified (e.g.,LDAP_AUTH_SIMPLEwas specified and the entry does not have auserPasswordattribute).LDAP_INVALID_CREDENTIALSβ invalid credentials were presented (e.g., the wrong password). wrong password era πLDAP_INSUFFICIENT_ACCESSβ the user has insufficient access to perform the operation. bestie does not have the clearance.LDAP_BUSYβ the DSA is busy.LDAP_UNAVAILABLEβ the DSA is unavailable.LDAP_UNWILLING_TO_PERFORMβ the DSA is unwilling to perform the operation. not "can't". unwilling. respect the boundary πLDAP_LOOP_DETECTβ a loop was detected.LDAP_NAMING_VIOLATIONβ a naming violation occurred.LDAP_OBJECT_CLASS_VIOLATIONβ an object class violation occurred (e.g., a "must" attribute was missing from the entry).LDAP_NOT_ALLOWED_ON_NONLEAFβ the operation is not allowed on a nonleaf object.LDAP_NOT_ALLOWED_ON_RDNβ the operation is not allowed on an RDN.LDAP_ALREADY_EXISTSβ the entry already exists. she was already there, you're late π«ΆLDAP_NO_OBJECT_CLASS_MODSβ object class modifications are not allowed.LDAP_OTHERβ an unknown error occurred. the catch-all. the mystery box. the "idk her" of codes π
β API ERROR CODES β
this section is a complete list of API error codes recognized by the library β so every single one is right here, no crumbs left behind. β¨
note bestie:LDAP_SUCCESSindicates success of an API call in addition to representing the return of the LDAP 'success'resultCode. one code, two jobs, main character energy.
LDAP_SERVER_DOWNβ the LDAP library can't contact the LDAP server. ghosted. π΅LDAP_LOCAL_ERRORβ some local error occurred. this is usually a failed dynamic memory allocation.LDAP_ENCODING_ERRORβ an error was encountered encoding parameters to send to the LDAP server.LDAP_DECODING_ERRORβ an error was encountered decoding a result from the LDAP server.LDAP_TIMEOUTβ a timelimit was exceeded while waiting for a result. we waited. it didn't come. β³LDAP_AUTH_UNKNOWNβ the authentication method specified toldap_bind()is not known.LDAP_FILTER_ERRORβ an invalid filter was supplied toldap_search()(e.g., unbalanced parentheses). parenthesis check bestie, fr frLDAP_PARAM_ERRORβ an ldap routine was called with a bad parameter.LDAP_NO_MEMORYβ an memory allocation (e.g.,malloc(3)or other dynamic memory allocator) call failed in an ldap library routine. (yes, the original says "an memory allocation" β we keep it, we don't fix it, we love her anyway π)LDAP_USER_CANCELEDβ indicates the user cancelled the operation. valid. we've all been there.LDAP_CONNECT_ERRORβ indicates a connection problem.LDAP_NOT_SUPPORTEDβ indicates the routine was called in a manner not supported by the library.LDAP_CONTROL_NOT_FOUNDβ indicates the control provided is unknown to the client library.LDAP_NO_RESULTS_RETURNEDβ indicates no results returned. nothing. empty. the void. πLDAP_MORE_RESULTS_TO_RETURNβ indicates more results could be returned. she's not done yet πLDAP_CLIENT_LOOPβ indicates the library has detected a loop in its processing.LDAP_REFERRAL_LIMIT_EXCEEDEDβ indicates the referral limit has been exceeded. too many referrals, this is not a doctor's office π©Ί
π§ DEPRECATED π§
okay so deprecated interfaces generally remain in the library β they're not gone, they're just on thin ice.
the macro LDAP_DEPRECATED can be defined to a non-zero value (e.g., -DLDAP_DEPRECATED=1) when compiling program designed to use deprecated interfaces. (yes, the original says "program" singular, we're keeping it, character for character queen π)
the actual recommendation: it is recommended that developers writing new programs, or updating old programs, avoid use of deprecated interfaces. over time, it is expected that documentation (and, eventually, support) for deprecated interfaces to be eliminated. so likeβ¦ don't build your whole personality on deprecated interfaces, bestie. they will leave. π
π SEE ALSO π
(yes, that's the whole list. she's concise. periodt.)
π 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. π absolute legends, no cap.
and that's the page!! this was OpenLDAP 2.6.16, dated 2026/10/21 β go forth and translate your error codes with confidence bestie, you've got this π β¨π¦
π¦ 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