NAME | SYNOPSIS | DESCRIPTION | ERRORS | ATTRIBUTES | SEE ALSO
cc[ flag... ] file... -lldap[ library... ] #include <lber.h> #include <ldap.h>struct ldap_error(int e_code, char *e_reason);
struct ldaperror ldap_errlist[];char *ldap_err2string(int err);
These functions provide interpretation of the various error codes returned by the LDAP protocol and LDAP library functions and assigned to an error field in the ld structure. ldap_perror() and ldap_result2error() functions are deprecated for all new development; ldap_err2string() should be used instead.
The ldap_result2error() function takes res, a result as produced by ldap_result(3LDAP) or other synchronous LDAP calls, and returns the corresponding error code. Possible error codes are listed below. If the freeit parameter is non zero it indicates that the res parameter should be freed by a call to ldap_msgfree(3LDAP) after the error code has been extracted. The error field in ld is set and returned.
The returned value can be passed to ldap_err2string() or looked up in ldap_errlist[ ] to get a text description of the message. The string returned from ldap_err2string() is a pointer to a static area that should not be modified. The last element in the ldap_errlist[ ] array is signaled by an error code of -1.
The ldap_perror() function can be called to print an indication of the error on standard error, similar to the way perror(3C) works.
The possible values for an ldap error code are:
The request was successful.
An operations error occurred.
A protocol violation was detected.
An LDAP time limit was exceeded.
An LDAP size limit was exceeded.
A compare operation returned false.
A compare operation returned true.
The LDAP server does not support strong authentication.
Strong authentication is required for the operation.
Partial results only returned.
The attribute type specified does not exist in the entry.
The attribute type specified is invalid.
Filter type not supported for the specified attribute.
An attribute value specified violates some constraint (for example, a postalAddress has too many lines, or a line that is too long).
An attribute type or attribute value specified already exists in the entry.
An invalid attribute value was specified.
The specified object does not exist in The Directory.
An alias in The Directory points to a nonexistent entry.
A syntactically invalid DN was specified.
The object specified is a leaf.
A problem was encountered when dereferencing an alias.
Inappropriate authentication was specified (for example, LDAP_AUTH_SIMPLE was specified and the entry does not have a userPassword attribute).
Invalid credentials were presented (for example, the wrong password).
The user has insufficient access to perform the operation.
The DSA is busy.
The DSA is unavailable.
The DSA is unwilling to perform the operation.
A loop was detected.
A naming violation occurred.
An object class violation occurred (for example, a "must" attribute was missing from the entry).
The operation is not allowed on a nonleaf object.
The operation is not allowed on an RDN.
The entry already exists.
Object class modifications are not allowed.
An unknown error occurred.
The LDAP library can't contact the LDAP server.
Some local error occurred. This is usually a failed malloc.
An error was encountered encoding parameters to send to the LDAP server.
An error was encountered decoding a result from the LDAP server.
A timelimit was exceeded while waiting for a result.
The authentication method specified to ldap_bind( ) is not known.
An invalid filter was supplied to ldap_search( ) (for example, unbalanced parentheses).
An ldap function was called with a bad parameter (for example, a NULL ld pointer, etc.).
An memory allocation (for example, malloc(3N)) call failed in an ldap library function.
See attributes(5) for a description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Availability | SUNWlldap (32-bit) |
SUNWldapx (64-bit) | |
Stability Level | Evolving |
NAME | SYNOPSIS | DESCRIPTION | ERRORS | ATTRIBUTES | SEE ALSO