LDAP_ERROR(3LDAP) | LDAP Library Functions | LDAP_ERROR(3LDAP) |
ldap_error, ldap_err2string, ldap_perror, ldap_result2error - LDAP protocol error handling functions
cc[ flag... ] file... -lldap[ library... ] #include <lber.h> #include <ldap.h> char *ldap_err2string(int err);
void ldap_perror(LDAP *ld, const char *s);
int ldap_result2error(LDAP *ld, LDAPMessage *res, int freeit);
These functions interpret the error codes that are returned by the LDAP API routines. The ldap_perror() and ldap_result2error() functions are deprecated for all new development. Use ldap_err2string() instead.
You can also use ldap_parse_sasl_bind_result(3LDAP), ldap_parse_extended_result(3LDAP), and ldap_parse_result(3LDAP) to provide error handling and interpret error codes returned by LDAP API functions.
The ldap_err2string() function takes err, a numeric LDAP error code, returned either by ldap_parse_result(3LDAP) or another LDAP API call. It returns an informative, null-terminated, character string that describes the error.
The ldap_result2error() function takes res, a result produced by ldap_result(3LDAP) or other synchronous LDAP calls, and returns the corresponding error code. If the freeit parameter is non-zero, it indicates that the res parameter should be freed by a call to ldap_result(3LDAP) after the error code has been extracted.
Similar to the way perror(3C) works, the ldap_perror() function can be called to print an indication of the error to standard error.
The possible values for an LDAP error code are:
LDAP_SUCCESS
LDAP_OPERATIONS_ERROR
LDAP_PROTOCOL_ERROR
LDAP_TIMELIMIT_EXCEEDED
LDAP_SIZELIMIT_EXCEEDED
LDAP_COMPARE_FALSE
LDAP_COMPARE_TRUE
LDAP_STRONG_AUTH_NOT_SUPPORTED
LDAP_STRONG_AUTH_REQUIRED
LDAP_PARTIAL_RESULTS
LDAP_NO_SUCH_ATTRIBUTE
LDAP_UNDEFINED_TYPE
LDAP_INAPPROPRIATE_MATCHING
LDAP_CONSTRAINT_VIOLATION
LDAP_TYPE_OR_VALUE_EXISTS
LDAP_INVALID_SYNTAX
LDAP_NO_SUCH_OBJECT
LDAP_ALIAS_PROBLEM
LDAP_INVALID_DN_SYNTAX
LDAP_IS_LEAF
LDAP_ALIAS_DEREF_PROBLEM
LDAP_INAPPROPRIATE_AUTH
LDAP_INVALID_CREDENTIALS
LDAP_INSUFFICIENT_ACCESS
LDAP_BUSY
LDAP_UNAVAILABLE
LDAP_UNWILLING_TO_PERFORM
LDAP_LOOP_DETECT
LDAP_NAMING_VIOLATION
LDAP_OBJECT_CLASS_VIOLATION
LDAP_NOT_ALLOWED_ON_NONLEAF
LDAP_NOT_ALLOWED_ON_RDN
LDAP_ALREADY_EXISTS
LDAP_NO_OBJECT_CLASS_MODS
LDAP_OTHER
LDAP_SERVER_DOWN
LDAP_LOCAL_ERROR
LDAP_ENCODING_ERROR
LDAP_DECODING_ERROR
LDAP_TIMEOUT
LDAP_AUTH_UNKNOWN
LDAP_FILTER_ERROR
LDAP_PARAM_ERROR
LDAP_NO_MEMORY
LDAP_CONNECT_ERROR
LDAP_NOT_SUPPORTED
LDAP_CONTROL_NOT_FOUND
LDAP_NO_RESULTS_RETURNED
LDAP_MORE_RESULTS_TO_RETURN
LDAP_CLIENT_LOOP
LDAP_REFERRAL_LIMIT_EXCEEDED
See attributes(7) for a description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
fflush(3C), ldap(3LDAP), ldap_bind(3LDAP), ldap_result(3LDAP), ldap_parse_extended_result(3LDAP), ldap_parse_result(3LDAP), ldap_parse_sasl_bind_result(3LDAP), ldap_search(3LDAP), malloc(3C), perror(3C) , attributes(7)
August 29, 2021 | OmniOS |