1 .TH SLAPO-RETCODE 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2007 The OpenLDAP Foundation, All Rights Reserved.
3 .\" Copying restrictions apply. See the COPYRIGHT file.
4 .\" Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
7 slapo-retcode \- return code overlay
15 is useful to test the behavior of clients when server-generated erroneous
16 and/or unusual responses occur, e.g. error codes, referrals,
17 excessive response times and so on.
19 The error responses are generated according to different strategies.
21 In the first case, all operations targeted at a specific configurable
22 subtree cause the object related to the request DN to be looked up
23 and checked for return code data: a response code, plus an optional
24 textual message, an optional configurable delay, an optional matched DN
25 field, and, when the response code is "referral", a (list of) referral(s).
27 Well-known response codes from standard track documents are provided
28 in \fBretcode.conf\fP, which can be included after instantiating
31 In the second case, objects of classes inherited from
32 the \fBerrAbsObject\fP, like \fBerrObject\fP or \fBerrAuxObject\fP,
33 when returned as intermediate responses of a search request, are changed
34 into the response dictated by their content.
36 A third mode causes objects to be looked up from the underlying database
37 to discover if their class inherits from \fBerrABsObject\fP;
38 in that case, their content is used to compute the corresponding response.
40 The behavior is disabled by using the \fBmanageDSAit\fP control (RFC 3296);
41 in that case, the resulting object, either present in the directory
42 or dynamically generated by the overlay, or contained in the request,
45 The config directives that are specific to the
47 overlay must be prefixed by
49 to avoid conflicts with directives specific to the underlying database
50 or to other stacked overlays. The following specific directives
51 can be used to configure the retcode overlay:
53 .B retcode\-parent <DN>
54 This directive defines the parent DN where dynamically generated
56 If not defined, the suffix of the database is used.
59 .B retcode\-item <RDN> <errCode> [op=<oplist>] [text=<message>]
60 .B [ref=<referral>] [sleeptime=<sec>] [matched=<DN>]
61 .B [unsolicited=<OID>[:<data>]] [flags=disconnect[,...]]
63 A dynamically generated entry, located below \fBretcode\-parent\fP.
64 The \fBerrCode\fP is the number of the response code;
65 it can be in any format supported by
67 The optional \fBoplist\fP is a list of operations that cause
68 response code generation; if absent, all operations are affected.
69 The \fBmatched\fP field is the matched DN that is returned
70 along with the error, while the \fBtext\fP field is an optional
72 The \fBref\fP field is only allowed for the \fBreferral\fP
74 The \fBsleeptime\fP field causes
76 to sleep the specified number of seconds before proceeding
78 The \fBunsolicited\fP field can be used to cause the return
79 of an RFC 4511 unsolicited response message; if \fBOID\fP
80 is not "0", an extended response is generated, with the optional
82 If \fBflags\fP contains \fBdisconnect\fP,
84 disconnects abruptly, without notice.
88 Enables exploitation of in-directory stored errAbsObject.
89 May result in a lot of unnecessary overhead.
91 .B retcode\-sleep [-]<n>
92 Defines a sleep time in seconds that is spent before actually handling
94 If negative, a random time between 0 and the absolute value of the argument
100 overlay utilizes the "return code" schema described herein.
101 This schema is specifically designed for use with this
102 overlay and is not intended to be used otherwise.
103 It is also noted that the schema describe here is
106 and hence subject to change without notice.
107 The schema is loaded automatically by the overlay.
109 The schema includes a number of object classes and associated
110 attribute types as described below.
115 ( 1.3.6.1.4.1.4203.666.11.4.1.1
117 DESC 'LDAP error code'
118 EQUALITY integerMatch
119 ORDERING integerOrderingMatch
120 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
124 The operations that trigger the response code:
126 ( 1.3.6.1.4.1.4203.666.11.4.1.2
128 DESC 'Operations the errObject applies to'
129 EQUALITY caseIgnoreMatch
130 SUBSTR caseIgnoreSubstringsMatch
131 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
136 ( 1.3.6.1.4.1.4203.666.11.4.1.3
138 DESC 'LDAP error textual description'
139 EQUALITY caseIgnoreMatch
140 SUBSTR caseIgnoreSubstringsMatch
141 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
145 The sleep time before the response is actually returned to the client:
147 ( 1.3.6.1.4.1.4203.666.11.4.1.4
148 NAME ( 'errSleepTime' )
149 DESC 'Time to wait before returning the error'
150 EQUALITY integerMatch
151 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
155 The matched DN returned to the client:
157 ( 1.3.6.1.4.1.4203.666.11.4.1.5
158 NAME ( 'errMatchedDN' )
159 DESC 'Value to be returned as matched DN'
160 EQUALITY distinguishedNameMatch
161 SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
165 The OID to be returned as extended response OID
166 in RFC 4511 unsolicited responses
167 ("0" generates a regular response with msgid set to 0):
169 ( 1.3.6.1.4.1.4203.666.11.4.1.6
170 NAME ( 'errUnsolicitedOID' )
171 DESC 'OID to be returned within unsolicited response'
172 EQUALITY objectIdentifierMatch
173 SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
177 The octet string to be returned as extended response data
178 in RFC 4511 unsolicited response:
180 ( 1.3.6.1.4.1.4203.666.11.4.1.7
181 NAME ( 'errUnsolicitedData' )
182 DESC 'Data to be returned within unsolicited response'
183 SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
189 disconnects abruptly without notice:
191 ( 1.3.6.1.4.1.4203.666.11.4.1.8
192 NAME ( 'errDisconnect' )
193 DESC 'Disconnect without notice'
194 SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
198 The abstract class that triggers the overlay:
200 ( 1.3.6.1.4.1.4203.666.11.4.3.0
201 NAME ( 'errAbsObject' )
204 MAY ( cn $ description $ errOp $ errText $ errSleepTime
208 The standalone structural objectclass for specifically created data:
210 ( 1.3.6.1.4.1.4203.666.11.4.3.1
212 SUP errAbsObject STRUCTURAL )
215 The auxiliary objectclass to alter the behavior of existing objects:
217 ( 1.3.6.1.4.1.4203.666.11.4.3.2
218 NAME ( 'errAuxObject' )
219 SUP errAbsObject AUXILIARY )
227 retcode-parent "ou=RetCodes,dc=example,dc=com"
228 include ./retcode.conf
230 # Wait 10 seconds, then return success (0x00)
231 retcode-item "cn=Success after 10 seconds" 0x00 sleeptime=10
232 # Wait 10 seconds, then return timelimitExceeded (0x03)
233 retcode-item "cn=Timelimit after 10 seconds" 0x03 sleeptime=10
242 default slapd configuration file
248 This module was written in 2005 by Pierangelo Masarati for SysNet s.n.c.