Mozilla LDAP C SDK Programmer's Guide

Chapter 19 - Result Codes

This chapter lists the result codes that can be returned by functions in the LDAP C SDK. These codes are specified in the LDAP protocol.

For ease of reference, this chapter lists the result codes in two formats:

Result Codes Listed Alphabetically

Result Codes Listed in Numerical Order

  1. LDAP_SUCCESS
  2. LDAP_OPERATIONS_ERROR
  3. LDAP_PROTOCOL_ERROR
  4. LDAP_TIMELIMIT_EXCEEDED
  5. LDAP_SIZELIMIT_EXCEEDED
  6. LDAP_COMPARE_FALSE
  7. LDAP_COMPARE_TRUE
  8. LDAP_STRONG_AUTH_NOT_SUPPORTED
  9. LDAP_STRONG_AUTH_REQUIRED
  10. LDAP_PARTIAL_RESULTS
  11. LDAP_REFERRAL
  12. LDAP_ADMINLIMIT_EXCEEDED
  13. LDAP_UNAVAILABLE_CRITICAL_EXTENSION
  14. LDAP_CONFIDENTIALITY_REQUIRED
  15. LDAP_SASL_BIND_IN_PROGRESS
  16. LDAP_NO_SUCH_ATTRIBUTE
  17. LDAP_UNDEFINED_TYPE
  18. LDAP_INAPPROPRIATE_MATCHING
  19. LDAP_CONSTRAINT_VIOLATION
  20. LDAP_TYPE_OR_VALUE_EXISTS
  21. LDAP_INVALID_SYNTAX
  22. LDAP_NO_SUCH_OBJECT
  23. LDAP_ALIAS_PROBLEM
  24. LDAP_INVALID_DN_SYNTAX
  25. LDAP_IS_LEAF
  26. LDAP_ALIAS_DEREF_PROBLEM
  27. LDAP_INAPPROPRIATE_AUTH
  28. LDAP_INVALID_CREDENTIALS
  29. LDAP_INSUFFICIENT_ACCESS
  30. LDAP_BUSY
  31. LDAP_UNAVAILABLE
  32. LDAP_UNWILLING_TO_PERFORM
  33. LDAP_LOOP_DETECT
  34. LDAP_SORT_CONTROL_MISSING
  35. LDAP_INDEX_RANGE_ERROR
  36. LDAP_NAMING_VIOLATION
  37. LDAP_OBJECT_CLASS_VIOLATION
  38. LDAP_NOT_ALLOWED_ON_NONLEAF
  39. LDAP_NOT_ALLOWED_ON_RDN
  40. LDAP_ALREADY_EXISTS
  41. LDAP_NO_OBJECT_CLASS_MODS
  42. LDAP_RESULTS_TOO_LARGE
  43. LDAP_AFFECTS_MULTIPLE_DSAS
  44. LDAP_OTHER
  45. LDAP_SERVER_DOWN
  46. LDAP_LOCAL_ERROR
  47. LDAP_ENCODING_ERROR
  48. LDAP_DECODING_ERROR
  49. LDAP_TIMEOUT
  50. LDAP_AUTH_UNKNOWN
  51. LDAP_FILTER_ERROR
  52. LDAP_USER_CANCELLED
  53. LDAP_PARAM_ERROR
  54. LDAP_NO_MEMORY
  55. LDAP_CONNECT_ERROR
  56. LDAP_NOT_SUPPORTED
  57. LDAP_CONTROL_NOT_FOUND
  58. LDAP_NO_RESULTS_RETURNED
  59. LDAP_MORE_RESULTS_TO_RETURN
  60. LDAP_CLIENT_LOOP
  61. LDAP_REFERRAL_LIMIT_EXCEEDED

LDAP_ADMINLIMIT_EXCEEDED

This result code indicates that the "look through limit" on a search operation has been exceeded. When working with the Directory Server, keep in mind the following:

The "look through limit" is the maximum number of entries that the server will check when gathering a list of potential search result candidates. See the Directory Server Administrator's Guide for details.

LDAP_AFFECTS_MULTIPLE_DSAS

This result code indicates that the requested operation needs to be performed on multiple servers, where this operation is not permitted. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_ALIAS_DEREF_PROBLEM

This result code indicates that a problem occurred when dereferencing an alias. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_ALIAS_PROBLEM

This result code indicates that a problem occurred when dereferencing an alias. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_ALREADY_EXISTS

This result code indicates that the request is attempting to add an entry that already exists in the directory. The Directory Server sends this result code back to the client in the following situations:

LDAP_AUTH_UNKNOWN

This result code indicates that an unknown authentication method was specified. The LDAP API library sets this result code if ldap_bind() or ldap_bind_s() are called and an authentication method other than LDAP_AUTH_SIMPLE is specified. (These functions only allow you to use simple authentication.)

LDAP_BUSY

This result code indicates that the server is currently too busy to perform the requested operation. At this point in time, neither the LDAP API library nor the Directory Server return this result code.

LDAP_CLIENT_LOOP

This result code indicates that the LDAP client (API library) detected a loop, for example, when following referrals.

LDAP_COMPARE_FALSE

This result code is returned after an LDAP compare operation is completed. The result indicates that the specified attribute value is not present in the specified entry.

LDAP_COMPARE_TRUE

This result code is returned after an LDAP compare operation is completed. The result indicates that the specified attribute value is present in the specified entry.

LDAP_CONFIDENTIALITY_REQUIRED

This result code indicates that confidentiality is required for the operation. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_CONNECT_ERROR

This result code indicates that the LDAP client cannot establish a connection (or has lost the connection) with the LDAP server.

The LDAP API library sets this result code. If you have not established an initial connection with the server, verify that you have specified the correct hostname and port number and that the server is running.

If you have lost the connection to the server, see "Handling Failover" for instructions on reconnecting to the server.

LDAP_CONSTRAINT_VIOLATION

This result code indicates that a value in the request does not comply with certain constraints. The Directory Server sends this result code back to the client in the following situations:

LDAP_CONTROL_NOT_FOUND

This result code indicates that a requested LDAP control was not found.

The LDAP API library sets this result code when parsing a server response for controls and not finding the requested controls. For example:

For more information on controls, see Chapter 14 - Working with LDAP Controls.

LDAP_DECODING_ERROR

This result code indicates that the LDAP client encountered an error when decoding the LDAP response received from the server.

LDAP_ENCODING_ERROR

This result code indicates that the LDAP client encountered an error when encoding the LDAP request to be sent to the server.

LDAP_FILTER_ERROR

This result code indicates that an error occurred when specifying the search filter. The LDAP API library sets this result code if it cannot encode the specified search filter in an LDAP search request.

LDAP_INAPPROPRIATE_AUTH

This result code indicates that the type of credentials are not appropriate for the method of authentication used. The Directory Server sends this result code back to the client if simple authentication is used in a bind request, but the entry has no userpassword attribute. And if SASL EXTERNAL is attempted on a non-SSL connection.

LDAP_INAPPROPRIATE_MATCHING

This result code indicates that an extensible match filter in a search request contained a matching rule that does not apply to the specified attribute type. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_INDEX_RANGE_ERROR

This result code indicates that the search results exceeded the range specified by the requested offsets. This result code applies to search requests that contain "virtual list view" controls. For more information on this control, see "Using the Virtual List View Control."

Note that versions of the Directory Server prior to 4.0 do not support the "virtual list view" control.

LDAP_INSUFFICIENT_ACCESS

This result code indicates that the client has insufficient access to perform the operation. Check the user that you are authenticating as and the access control lists for the server.

LDAP_INVALID_CREDENTIALS

This result code indicates that the credentials provided in the request are invalid. The Directory Server sends this result code back to the client if a bind request contains the incorrect credentials for a user or if a user's password has already expired.

LDAP_INVALID_DN_SYNTAX

This result code indicates than an invalid DN has been specified. The Directory Server sends this result code back to the client if an add request or a modify DN request specifies an invalid DN. It also sends this code when an SASL_EXTERNAL bind is attempted but certification to DN mapping fails.

LDAP_INVALID_SYNTAX

This result code indicates that the request contains invalid syntax. The Directory Server sends this result code back to the client in the following situations:

LDAP_IS_LEAF

This result code indicates that the specified entry is a leaf entry. Currently, Directory Server does not send this result code back to LDAP clients.

LDAP_LOCAL_ERROR

This result code indicates that an error occurred in the LDAP client.

LDAP_LOOP_DETECT

This result code indicates that the server was unable to perform the requested operation because of an internal loop. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_MORE_RESULTS_TO_RETURN

This result code indicates that there are more results in the chain of results. The LDAP API library sets this result code when the ldap_parse_sasl_bind_result() function is called to retrieve the result code of an operation, and additional result codes from the server are available in the LDAP structure.

LDAP_NAMING_VIOLATION

This result code indicates that the request violates the structure of the DIT. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_NO_MEMORY

This result code indicates that no memory is available. The LDAP API library sets this result code if a function cannot allocate memory (for example, when creating an LDAP request or an LDAP control).

LDAP_NO_OBJECT_CLASS_MODS

This result code indicates that the request is attempting to modify the object class that should not be modified (for example, a structural object class). Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_NO_RESULTS_RETURNED

This result code indicates that no results were returned from the server. The LDAP API library sets this result code when the ldap_parse_result() function is called but no result code is included in the server's response.

LDAP_NO_SUCH_ATTRIBUTE

This result code indicates that the specified attribute does not exist in the entry. The Directory Server might send this result code back to the client if, for example, a modify request specifies the modification or removal of a non-existent attribute or if a compare request specifies a non-existent attribute.

LDAP_NO_SUCH_OBJECT

This result code indicates that the server cannot find an entry specified in the request. The Directory Server sends this result code back to the client if it cannot find a requested entry and if it cannot refer your client to another LDAP server.

LDAP_NOT_ALLOWED_ON_NONLEAF

This result code indicates that the requested operation is allowed only on entries that do not have child entries (entries that are "leaf" entries, as opposed to "branch" entries). The Directory Server sends this result code back to the client if the request is a delete request or a modify DN request and the entry is a parent entry. (You cannot delete or move a branch of entries in a single operation.)

LDAP_NOT_ALLOWED_ON_RDN

This result code indicates that the requested operation will affect the RDN of the entry. The Directory Server sends this result code back to the client if the request is a modify request and the request deletes attribute values from the entry that are used in the RDN of the entry. (For example, if the DN is "uid=bjensen,ou=People,dc=example,dc=com", the request removes the attribute value "uid=bjensen" from the entry.)

LDAP_NOT_SUPPORTED

This result code indicates that the LDAP client is attempting to use functionality that is not supported. The LDAP API library sets this result code if the client identifies itself as an LDAPv2 client, and the client is attempting to use functionality available in LDAPv3. For example:

If you want to use these features, make sure to specify that your LDAP client is an LDAPv3 client. For instructions, see "Specifying the LDAP Version of Your Client."

LDAP_OBJECT_CLASS_VIOLATION

This result code indicates that the request specifies a change to an entry or a new entry that does not comply with the server's schema. The Directory Server sends this result code back to the client in the following situations:

Check the server error logs for more information, and check the schema for the type of entry that you are adding or modifying.

LDAP_OPERATIONS_ERROR

This is a general result code indicating that an error has occurred. The Directory Server might send this code if, for example, memory cannot be allocated on the server.

To troubleshoot this type of error, check the server's error logs. You may need to increase the log level of the server to get additional information.

LDAP_OTHER

This result code indicates than an unknown error has occurred. At this point in time, neither the LDAP API library nor the Directory Server return this result code.

LDAP_PARAM_ERROR

This result code indicates that an invalid parameter was specified.

The LDAP API library sets this result code if a function was called and invalid parameters were specified (for example, if the LDAP structure is NULL).

LDAP_PARTIAL_RESULTS

The Directory Server sends this result code to LDAPv2 clients to refer them to another LDAP server. When sending this code to a client, the server includes a newline-delimited list of LDAP URLs that identify another LDAP server.

If the client identifies itself as an LDAPv3 client in the request, the Directory Server sends an LDAP_REFERRAL result code instead of this result code.

LDAP_PROTOCOL_ERROR

This result code indicates that the LDAP client's request does not comply with the LDAP protocol. The Directory Server sends this result code back to the client in the following situations:

To troubleshoot this type of error, check the server's error logs. You may need to increase the log level of the server to get additional information.

LDAP_REFERRAL

This result code indicates that the server is referring the client to another LDAP server. When sending this code to a client, the server includes a list of LDAP URLs that identify another LDAP server. This result code is part of the LDAPv3 protocol. For LDAPv2 clients, the Directory Server sends an LDAP_PARTIAL_RESULTS result code instead.

LDAP_REFERRAL_LIMIT_EXCEEDED

This result code indicates that the "referral hop limit" was exceeded. The LDAP API library sets this result code when following referrals, if the client is referred to other servers more times than allowed by the "referral hop limit". For more information about the "referral hop limit", see "Limiting Referral Hops."

LDAP_RESULTS_TOO_LARGE

This result code indicates that the results of the request are too large. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_SASL_BIND_IN_PROGRESS

This result code is used in multi-stage SASL bind operations. The server sends this result code back to the client to indicate that the authentication process has not yet completed. For more information on SASL authentication, see Chapter 13 - Using SASL Authentication.

LDAP_SERVER_DOWN

This result code indicates that the LDAP API library cannot establish a connection (or lost the connection) with the LDAP server. The LDAP API library sets this result code. If you have not established an initial connection with the server, verify that you have specified the correct hostname and port number and that the server is running.

If you have lost the connection to the server, see "Handling Failover" for instructions on reconnecting to the server.

LDAP_SIZELIMIT_EXCEEDED

This result code indicates that the maximum number of search results to return has been exceeded. The size limit is specified in the search request. If you specify no size limit, the server will set the time limit.

When working with the Directory Server, keep in mind the following:

LDAP_SORT_CONTROL_MISSING

This result code indicates that server did not receive a required server-side sorting control. The Directory Server 4.0 sends this result code back to the client if the server receives a search request with a "virtual list view" control but no server-side sorting control.

The "virtual list view" control requires a server-side sorting control. For more information on this control, see "Using the Virtual List View Control." Note that versions of the Directory Server prior to 4.0 do not support the "virtual list view" control.

LDAP_STRONG_AUTH_NOT_SUPPORTED

This result code is returned as the result of a bind operation. This code indicates that the server does not recognize or support the specified authentication method.

LDAP_STRONG_AUTH_REQUIRED

This result code indicates that a stronger method of authentication is required to perform the operation. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_SUCCESS

This result code indicates that the LDAP operation was successful.

LDAP_TIMELIMIT_EXCEEDED

This result code indicates that the time limit on a search operation has been exceeded. The time limit is specified in the search request. If you specify no time limit, the server will set the time limit. When working with the Directory Server, keep in mind the following:

LDAP_TIMEOUT

This result code indicates that the LDAP client timed out while waiting for a response from the server. The LDAP API library sets this result code in the LDAP structure if the timeout period (for example, in a search request) has been exceeded and the server has not responded.

LDAP_TYPE_OR_VALUE_EXISTS

This result code indicates that the request attempted to add an attribute type or value that already exists. The Directory Server sends this result code back to the client in the following situations:

LDAP_UNAVAILABLE

This result code indicates that the server is unavailable to perform the requested operation. At this point in time, neither the LDAP API library nor the Directory Server return this result code.

LDAP_UNAVAILABLE_CRITICAL_EXTENSION

This result code indicates that the specified control or matching rule is not supported by the server. The Directory Server might send back this result code if the request includes an unsupported control or if the filter in the search request specifies an unsupported matching rule.

LDAP_UNDEFINED_TYPE

This result code indicates that the request specifies an undefined attribute type. Currently, the Directory Server does not send this result code back to LDAP clients.

LDAP_UNWILLING_TO_PERFORM

This result code indicates that the server is unwilling to perform to requested operation. The Directory Server sends this result code back to the client in the following situations:

LDAP_USER_CANCELLED

This result code indicates that the user cancelled the LDAP operation. Currently, the Directory Server does not send this result code back to LDAP clients.