summaryrefslogtreecommitdiffstats
path: root/ldb/include/ldb_errors.h
blob: 9362233fd5c51ccb713f2cdd0f6152dae2f396b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
/* 
   ldb database library

   Copyright (C) Simo Sorce  2005

     ** NOTE! The following LGPL license applies to the ldb
     ** library. This does NOT imply that all of Samba is released
     ** under the LGPL
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 3 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/

/*
 *  Name: ldb
 *
 *  Component: ldb header
 *
 *  Description: defines error codes following RFC 2251 ldap error codes
 *
 *  Author: Simo Sorce
 */

#ifndef _LDB_ERRORS_H_

/*! \cond DOXYGEN_IGNORE */
#define _LDB_ERRORS_H_ 1
/*! \endcond */

/** 
   \file ldb_errors.h

   This header provides a set of result codes for LDB function calls.

   Many LDB function calls return an integer value (int). As shown in
   the function documentation, those return values may indicate
   whether the function call worked correctly (in which case it
   returns LDB_SUCCESS) or some problem occurred (in which case some
   other value will be returned). As a special case,
   LDB_ERR_COMPARE_FALSE or LDB_ERR_COMPARE_TRUE may be returned,
   which does not indicate an error.

   \note Not all error codes make sense for LDB, however they are
   based on the LDAP error codes, and are kept for reference and to
   avoid overlap.

   \note Some of this documentation is based on information in
   the OpenLDAP documentation, as developed and maintained by the
   <a href="http://www.openldap.org/">The OpenLDAP Project</a>.
 */

/**
   The function call succeeded.

   If a function returns LDB_SUCCESS, then that function, and the
   underlying transactions that may have been required, completed
   successfully.
*/
#define LDB_SUCCESS				0

/**
   The function call failed for some non-specific reason.
*/
#define LDB_ERR_OPERATIONS_ERROR		1

/**
   The function call failed because of a protocol violation.
*/
#define LDB_ERR_PROTOCOL_ERROR			2

/**
   The function call failed because a time limit was exceeded.
*/
#define LDB_ERR_TIME_LIMIT_EXCEEDED		3

/**
   The function call failed because a size limit was exceeded.
*/
#define LDB_ERR_SIZE_LIMIT_EXCEEDED		4

/**
   The function was for value comparison, and the comparison operation
   returned false.

   \note This is a status value, and doesn't normally indicate an
   error.
*/
#define LDB_ERR_COMPARE_FALSE			5

/**
   The function was for value comparison, and the comparison operation
   returned true.

   \note This is a status value, and doesn't normally indicate an
   error.
*/
#define LDB_ERR_COMPARE_TRUE			6

/**
   The function used an authentication method that is not supported by
   the database.
*/
#define LDB_ERR_AUTH_METHOD_NOT_SUPPORTED	7

/**
   The function call required a underlying operation that required
   strong authentication.

   This will normally only occur if you are using LDB with a LDAP
   backend.
*/
#define LDB_ERR_STRONG_AUTH_REQUIRED		8
/* 9 RESERVED */

/**
   The function resulted in a referral to another server.
*/
#define LDB_ERR_REFERRAL			10

/**
   The function failed because an administrative / policy limit was
   exceeded.
*/
#define LDB_ERR_ADMIN_LIMIT_EXCEEDED		11

/**
   The function required an extension or capability that the
   database cannot provide.
*/
#define LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION	12

/**
   The function involved a transaction or database operation that
   could not be performed without a secure link.
*/
#define LDB_ERR_CONFIDENTIALITY_REQUIRED	13

/**
   This is an intermediate result code for SASL bind operations that
   have more than one step.

   \note This is a result code that does not normally indicate an
   error has occurred.
*/
#define LDB_ERR_SASL_BIND_IN_PROGRESS		14

/**
   The function referred to an attribute type that is not present in
   the entry.
*/
#define LDB_ERR_NO_SUCH_ATTRIBUTE		16

/**
   The function referred to an attribute type that is invalid
*/
#define LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE	17

/**
   The function required a filter type that is not available for the
   specified attribute.
*/
#define LDB_ERR_INAPPROPRIATE_MATCHING		18

/**
   The function would have violated an attribute constraint.
*/
#define LDB_ERR_CONSTRAINT_VIOLATION		19

/**
   The function involved an attribute type or attribute value that
   already exists in the entry.
*/
#define LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS	20
/**
   The function used an invalid (incorrect syntax) attribute value.
*/
#define LDB_ERR_INVALID_ATTRIBUTE_SYNTAX	21

/* 22-31 unused */

/**
   The function referred to an object that does not exist in the
   database.
*/
#define LDB_ERR_NO_SUCH_OBJECT			32

/**
   The function referred to an alias which points to a non-existant
   object in the database.
*/
#define LDB_ERR_ALIAS_PROBLEM			33

/**
   The function used a DN which was invalid (incorrect syntax).
*/
#define LDB_ERR_INVALID_DN_SYNTAX		34

/* 35 RESERVED */

/**
   The function required dereferencing of an alias, and something went
   wrong during the dereferencing process.
*/
#define LDB_ERR_ALIAS_DEREFERENCING_PROBLEM	36

/* 37-47 unused */

/**
   The function passed in the wrong authentication method.
*/
#define LDB_ERR_INAPPROPRIATE_AUTHENTICATION	48

/**
   The function passed in or referenced incorrect credentials during
   authentication. 
*/
#define LDB_ERR_INVALID_CREDENTIALS		49

/**
   The function required access permissions that the user does not
   possess. 
*/
#define LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS	50

/**
   The function required a transaction or call that the database could
   not perform because it is busy.
*/
#define LDB_ERR_BUSY				51

/**
   The function required a transaction or call to a database that is
   not available.
*/
#define LDB_ERR_UNAVAILABLE			52

/**
   The function required a transaction or call to a database that the
   database declined to perform.
*/
#define LDB_ERR_UNWILLING_TO_PERFORM		53

/**
   The function failed because it resulted in a loop being detected.
*/
#define LDB_ERR_LOOP_DETECT			54

/* 55-63 unused */

/**
   The function failed because it would have violated a naming rule.
*/
#define LDB_ERR_NAMING_VIOLATION		64

/**
   The function failed because it would have violated the schema.
*/
#define LDB_ERR_OBJECT_CLASS_VIOLATION		65

/**
   The function required an operation that is only allowed on leaf
   objects, but the object is not a leaf.
*/
#define LDB_ERR_NOT_ALLOWED_ON_NON_LEAF		66

/**
   The function required an operation that cannot be performed on a
   Relative DN, but the object is a Relative DN.
*/
#define LDB_ERR_NOT_ALLOWED_ON_RDN		67

/**
   The function failed because the entry already exists.
*/
#define LDB_ERR_ENTRY_ALREADY_EXISTS		68

/**
   The function failed because modifications to an object class are
   not allowable.
*/
#define LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED	69

/* 70 RESERVED FOR CLDAP */

/**
   The function failed because it needed to be applied to multiple
   databases.
*/
#define LDB_ERR_AFFECTS_MULTIPLE_DSAS		71

/* 72-79 unused */

/**
   The function failed for unknown reasons.
*/
#define LDB_ERR_OTHER				80

/* 81-90 RESERVED for APIs */

#endif /* _LDB_ERRORS_H_ */