1ldap_error(3LDAP) LDAP Library Functions ldap_error(3LDAP)
2
3
4
6 ldap_error, ldap_err2string, ldap_perror, ldap_result2error - LDAP pro‐
7 tocol error handling functions
8
10 cc[ flag... ] file... -lldap[ library... ]
11 #include <lber.h>
12 #include <ldap.h>
13
14 char *ldap_err2string(int err);
15
16
17 void ldap_perror(LDAP *ld, const char *s);
18
19
20 int ldap_result2error(LDAP *ld, LDAPMessage *res, int freeit);
21
22
24 These functions interpret the error codes that are returned by the LDAP
25 API routines. The ldap_perror() and ldap_result2error() functions are
26 deprecated for all new development. Use ldap_err2string() instead.
27
28
29 You can also use ldap_parse_sasl_bind_result(3LDAP),
30 ldap_parse_extended_result(3LDAP), and ldap_parse_result(3LDAP) to pro‐
31 vide error handling and interpret error codes returned by LDAP API
32 functions.
33
34
35 The ldap_err2string() function takes err, a numeric LDAP error code,
36 returned either by ldap_parse_result(3LDAP) or another LDAP API call.
37 It returns an informative, null-terminated, character string that
38 describes the error.
39
40
41 The ldap_result2error() function takes res, a result produced by
42 ldap_result(3LDAP) or other synchronous LDAP calls, and returns the
43 corresponding error code. If the freeit parameter is non-zero, it indi‐
44 cates that the res parameter should be freed by a call to
45 ldap_result(3LDAP) after the error code has been extracted.
46
47
48 Similar to the way perror(3C) works, the ldap_perror() function can be
49 called to print an indication of the error to standard error.
50
52 The possible values for an LDAP error code are:
53
54 LDAP_SUCCESS
55
56 The request was successful.
57
58
59 LDAP_OPERATIONS_ERROR
60
61 An operations error occurred.
62
63
64 LDAP_PROTOCOL_ERROR
65
66 A protocol violation was detected.
67
68
69 LDAP_TIMELIMIT_EXCEEDED
70
71 An LDAP time limit was exceeded.
72
73
74 LDAP_SIZELIMIT_EXCEEDED
75
76 An LDAP size limit was exceeded.
77
78
79 LDAP_COMPARE_FALSE
80
81 A compare operation returned false.
82
83
84 LDAP_COMPARE_TRUE
85
86 A compare operation returned true.
87
88
89 LDAP_STRONG_AUTH_NOT_SUPPORTED
90
91 The LDAP server does not support strong authentication.
92
93
94 LDAP_STRONG_AUTH_REQUIRED
95
96 Strong authentication is required for the operation.
97
98
99 LDAP_PARTIAL_RESULTS
100
101 Only partial results are returned.
102
103
104 LDAP_NO_SUCH_ATTRIBUTE
105
106 The attribute type specified does not exist in the entry.
107
108
109 LDAP_UNDEFINED_TYPE
110
111 The attribute type specified is invalid.
112
113
114 LDAP_INAPPROPRIATE_MATCHING
115
116 The filter type is not supported for the specified attribute.
117
118
119 LDAP_CONSTRAINT_VIOLATION
120
121 An attribute value specified violates some constraint. For example,
122 a postalAddress has too many lines, or a line that is too long.
123
124
125 LDAP_TYPE_OR_VALUE_EXISTS
126
127 An attribute type or attribute value specified already exists in
128 the entry.
129
130
131 LDAP_INVALID_SYNTAX
132
133 An invalid attribute value was specified.
134
135
136 LDAP_NO_SUCH_OBJECT
137
138 The specified object does not exist in the directory.
139
140
141 LDAP_ALIAS_PROBLEM
142
143 An alias in the directory points to a nonexistent entry.
144
145
146 LDAP_INVALID_DN_SYNTAX
147
148 A syntactically invalid DN was specified.
149
150
151 LDAP_IS_LEAF
152
153 The object specified is a leaf.
154
155
156 LDAP_ALIAS_DEREF_PROBLEM
157
158 A problem was encountered when dereferencing an alias.
159
160
161 LDAP_INAPPROPRIATE_AUTH
162
163 Inappropriate authentication was specified. For example,
164 LDAP_AUTH_SIMPLE was specified and the entry does not have a user‐
165 Password attribute.
166
167
168 LDAP_INVALID_CREDENTIALS
169
170 Invalid credentials were presented, for example, the wrong pass‐
171 word.
172
173
174 LDAP_INSUFFICIENT_ACCESS
175
176 The user has insufficient access to perform the operation.
177
178
179 LDAP_BUSY
180
181 The DSA is busy.
182
183
184 LDAP_UNAVAILABLE
185
186 The DSA is unavailable.
187
188
189 LDAP_UNWILLING_TO_PERFORM
190
191 The DSA is unwilling to perform the operation.
192
193
194 LDAP_LOOP_DETECT
195
196 A loop was detected.
197
198
199 LDAP_NAMING_VIOLATION
200
201 A naming violation occurred.
202
203
204 LDAP_OBJECT_CLASS_VIOLATION
205
206 An object class violation occurred. For example, a must attribute
207 was missing from the entry.
208
209
210 LDAP_NOT_ALLOWED_ON_NONLEAF
211
212 The operation is not allowed on a nonleaf object.
213
214
215 LDAP_NOT_ALLOWED_ON_RDN
216
217 The operation is not allowed on an RDN.
218
219
220 LDAP_ALREADY_EXISTS
221
222 The entry already exists.
223
224
225 LDAP_NO_OBJECT_CLASS_MODS
226
227 Object class modifications are not allowed.
228
229
230 LDAP_OTHER
231
232 An unknown error occurred.
233
234
235 LDAP_SERVER_DOWN
236
237 The LDAP library cannot contact the LDAP server.
238
239
240 LDAP_LOCAL_ERROR
241
242 Some local error occurred. This is usually the result of a failed
243 malloc(3C) call or a failure to fflush(3C) the stdio stream to
244 files, even when the LDAP requests were processed successfully by
245 the remote server.
246
247
248 LDAP_ENCODING_ERROR
249
250 An error was encountered encoding parameters to send to the LDAP
251 server.
252
253
254 LDAP_DECODING_ERROR
255
256 An error was encountered decoding a result from the LDAP server.
257
258
259 LDAP_TIMEOUT
260
261 A time limit was exceeded while waiting for a result.
262
263
264 LDAP_AUTH_UNKNOWN
265
266 The authentication method specified to ldap_bind(3LDAP) is not
267 known.
268
269
270 LDAP_FILTER_ERROR
271
272 An invalid filter was supplied to ldap_search(3LDAP), for example,
273 unbalanced parentheses.
274
275
276 LDAP_PARAM_ERROR
277
278 An LDAP function was called with a bad parameter, for example, a
279 NULL ld pointer, and the like.
280
281
282 LDAP_NO_MEMORY
283
284 A memory allocation call failed in an LDAP library function, for
285 example, malloc(3C).
286
287
288 LDAP_CONNECT_ERROR
289
290 The LDAP client has either lost its connetion to an LDAP server or
291 it cannot establish a connection.
292
293
294 LDAP_NOT_SUPPORTED
295
296 The requested functionality is not supported., for example, when an
297 LDAPv2 client requests some LDAPv3 functionality.
298
299
300 LDAP_CONTROL_NOT_FOUND
301
302 An LDAP client requested a control not found in the list of sup‐
303 ported controls sent by the server.
304
305
306 LDAP_NO_RESULTS_RETURNED
307
308 The LDAP server sent no results.
309
310
311 LDAP_MORE_RESULTS_TO_RETURN
312
313 More results are chained in the message chain.
314
315
316 LDAP_CLIENT_LOOP
317
318 A loop has been detected, for example, when following referrals.
319
320
321 LDAP_REFERRAL_LIMIT_EXCEEDED
322
323 The referral exceeds the hop limit. The hop limit determines the
324 number of servers that the client can hop through to retrieve data.
325
326
328 See attributes(5) for a description of the following attributes:
329
330
331
332
333 ┌─────────────────────────────┬─────────────────────────────┐
334 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
335 ├─────────────────────────────┼─────────────────────────────┤
336 │Availability │SUNWcsl (32-bit) │
337 │ │SUNWcslx (64-bit) │
338 ├─────────────────────────────┼─────────────────────────────┤
339 │Interface Stability │Committed │
340 └─────────────────────────────┴─────────────────────────────┘
341
343 fflush(3C), ldap(3LDAP), ldap_bind(3LDAP), ldap_result(3LDAP),
344 ldap_parse_extended_result(3LDAP), ldap_parse_result(3LDAP),
345 ldap_parse_sasl_bind_result(3LDAP), ldap_search(3LDAP), malloc(3C),
346 perror(3C) , attributes(5)
347
348
349
350SunOS 5.11 11 Nov 2008 ldap_error(3LDAP)