openldap/doc/man/man3/ldap_error.3

213 lines
5.5 KiB
Groff
Raw Normal View History

2002-06-13 11:59:10 +08:00
.TH LDAP_ERROR 3 "RELEASEDATE" "OpenLDAP LDVERSION"
1999-09-12 12:41:47 +08:00
.\" $OpenLDAP$
2005-01-02 04:49:32 +08:00
.\" Copyright 1998-2005 The OpenLDAP Foundation All Rights Reserved.
1999-09-12 12:41:47 +08:00
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
1998-08-09 08:43:13 +08:00
.SH NAME
ldap_perror, ld_errno, ldap_result2error, ldap_errlist, ldap_err2string \- LDAP protocol error handling routines
2002-06-21 15:32:54 +08:00
.SH LIBRARY
2002-06-22 05:25:38 +08:00
OpenLDAP LDAP (libldap, -lldap)
1998-08-09 08:43:13 +08:00
.SH SYNOPSIS
.nf
.ft B
#include <ldap.h>
.LP
.ft B
2001-07-24 14:26:32 +08:00
char *ldap_err2string( int err );
1998-08-09 08:43:13 +08:00
.LP
.ft B
2001-07-24 14:26:32 +08:00
void ldap_perror( LDAP *ld, const char *s )
1998-08-09 08:43:13 +08:00
.LP
.ft B
2001-07-24 14:26:32 +08:00
int ldap_result2error( LDAP *ld, LDAPMessage *res, int freeit )
1998-08-09 08:43:13 +08:00
.SH DESCRIPTION
These routines provide interpretation of the various error codes
returned by the LDAP protocol and LDAP library routines or associated
with an LDAP session. The error code associated with an LDAP session
is accessible using
.BR ldap_get_option (3)
and
.BR ldap_set_option (3)
with the
.B LDAP_OPT_RESULT_CODE
option (previously called
.BR LDAP_OPT_ERROR_NUMBER ).
1998-08-09 08:43:13 +08:00
.LP
The
.B ldap_result2error()
routine takes \fIres\fP, a result as produced by
.BR ldap_result (3)
or
.BR ldap_search_s (3),
and returns
the corresponding error code. Possible error codes are listed
below. If the \fIfreeit\fP parameter is non zero it indicates that the
\fIres\fP parameter should be freed by a call to
.BR ldap_msgfree (3)
after the error code has been extracted. The
.B ld_errno
field in \fIld\fP is set and returned.
.LP
The returned value can be passed to
.B ldap_err2string()
to get a text description of the message. The string
returned from
.B ldap_err2string()
is a pointer to a static area that
2001-07-24 14:26:32 +08:00
should not be modified.
1998-08-09 08:43:13 +08:00
.LP
The
.B ldap_perror()
routine can be called to print an indication of
the error on standard error, similar to the way
.BR perror (3)
works.
.SH ERRORS
The possible values for an ldap error code are:
.LP
.TP 20
.SM LDAP_SUCCESS
The request was successful.
.TP
.SM LDAP_OPERATIONS_ERROR
An operations error occurred.
.TP
.SM LDAP_PROTOCOL_ERROR
A protocol violation was detected.
.TP
.SM LDAP_TIMELIMIT_EXCEEDED
An LDAP time limit was exceeded.
.TP
.SM LDAP_SIZELIMIT_EXCEEDED
An LDAP size limit was exceeded.
.TP
.SM LDAP_COMPARE_FALSE
A compare operation returned false.
.TP
.SM LDAP_COMPARE_TRUE
A compare operation returned true.
.TP
.SM LDAP_STRONG_AUTH_NOT_SUPPORTED
The LDAP server does not support strong authentication.
.TP
.SM LDAP_STRONG_AUTH_REQUIRED
Strong authentication is required for the operation.
.TP
.SM LDAP_PARTIAL_RESULTS
Partial results only returned.
.TP
.SM LDAP_NO_SUCH_ATTRIBUTE
The attribute type specified does not exist in the entry.
.TP
.SM LDAP_UNDEFINED_TYPE
The attribute type specified is invalid.
.TP
.SM LDAP_INAPPROPRIATE_MATCHING
Filter type not supported for the specified attribute.
.TP
.SM LDAP_CONSTRAINT_VIOLATION
An attribute value specified violates some constraint (e.g., a postalAddress
has too many lines, or a line that is too long).
.TP
.SM LDAP_TYPE_OR_VALUE_EXISTS
An attribute type or attribute value specified already exists in the entry.
.TP
.SM LDAP_INVALID_SYNTAX
An invalid attribute value was specified.
.TP
.SM LDAP_NO_SUCH_OBJECT
The specified object does not exist in The Directory.
.TP
.SM LDAP_ALIAS_PROBLEM
An alias in The Directory points to a nonexistent entry.
.TP
.SM LDAP_INVALID_DN_SYNTAX
A syntactically invalid DN was specified.
.TP
.SM LDAP_IS_LEAF
The object specified is a leaf.
.TP
.SM LDAP_ALIAS_DEREF_PROBLEM
A problem was encountered when dereferencing an alias.
.TP
.SM LDAP_INAPPROPRIATE_AUTH
Inappropriate authentication was specified (e.g., LDAP_AUTH_SIMPLE was
specified and the entry does not have a userPassword attribute).
.TP
.SM LDAP_INVALID_CREDENTIALS
Invalid credentials were presented (e.g., the wrong password).
.TP
.SM LDAP_INSUFFICIENT_ACCESS
The user has insufficient access to perform the operation.
.TP
.SM LDAP_BUSY
The DSA is busy.
.TP
.SM LDAP_UNAVAILABLE
The DSA is unavailable.
.TP
.SM LDAP_UNWILLING_TO_PERFORM
The DSA is unwilling to perform the operation.
.TP
.SM LDAP_LOOP_DETECT
A loop was detected.
.TP
.SM LDAP_NAMING_VIOLATION
A naming violation occurred.
.TP
.SM LDAP_OBJECT_CLASS_VIOLATION
An object class violation occurred (e.g., a "must" attribute was missing
from the entry).
.TP
.SM LDAP_NOT_ALLOWED_ON_NONLEAF
The operation is not allowed on a nonleaf object.
.TP
.SM LDAP_NOT_ALLOWED_ON_RDN
The operation is not allowed on an RDN.
.TP
.SM LDAP_ALREADY_EXISTS
The entry already exists.
.TP
.SM LDAP_NO_OBJECT_CLASS_MODS
Object class modifications are not allowed.
.TP
.SM LDAP_OTHER
An unknown error occurred.
.TP
.SM LDAP_SERVER_DOWN
The LDAP library can't contact the LDAP server.
.TP
.SM LDAP_LOCAL_ERROR
Some local error occurred. This is usually a failed dynamic memory allocation.
1998-08-09 08:43:13 +08:00
.TP
.SM LDAP_ENCODING_ERROR
An error was encountered encoding parameters to send to the LDAP server.
.TP
.SM LDAP_DECODING_ERROR
An error was encountered decoding a result from the LDAP server.
.TP
.SM LDAP_TIMEOUT
A timelimit was exceeded while waiting for a result.
.TP
.SM LDAP_AUTH_UNKNOWN
The authentication method specified to ldap_bind() is not known.
.TP
.SM LDAP_FILTER_ERROR
An invalid filter was supplied to ldap_search() (e.g., unbalanced
parentheses).
.TP
.SM LDAP_PARAM_ERROR
2002-06-05 23:56:55 +08:00
An ldap routine was called with a bad parameter.
1998-08-09 08:43:13 +08:00
.TP
.SM LDAP_NO_MEMORY
An memory allocation (e.g., malloc(3) or other dynamic memory
allocator) call failed in an ldap
1998-08-09 08:43:13 +08:00
library routine.
.SH SEE ALSO
.BR ldap (3),
.BR perror (3)
1998-10-25 09:41:42 +08:00
.SH ACKNOWLEDGEMENTS
.B OpenLDAP
1998-10-25 09:41:42 +08:00
is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
.B OpenLDAP
1998-10-25 09:41:42 +08:00
is derived from University of Michigan LDAP 3.3 Release.