]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapo-retcode.5
Add -s warning
[openldap] / doc / man / man5 / slapo-retcode.5
1 .TH SLAPO-RETCODE5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2006 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>
5 .\" $OpenLDAP$
6 .SH NAME
7 slapo-retcode \- return code overlay
8 .SH SYNOPSIS
9 ETCDIR/slapd.conf
10 .SH DESCRIPTION
11 The
12 .B retcode
13 overlay to
14 .BR slapd (8)
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.
18
19 The error responses are generated according to different strategies.
20 .LP
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).
26 .LP
27 Well-known response codes from standard track documents are provided
28 in \fBretcode.conf\fP, which can be included after instantiating
29 the overlay.
30 .LP
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.
35 .LP
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.
39 .LP
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,
43 is handled as usual.
44 .LP 
45 The config directives that are specific to the
46 .B retcode
47 overlay must be prefixed by
48 .BR retcode\- ,
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: 
52 .TP
53 .B retcode\-parent <DN>
54 This directive defines the parent DN where dynamically generated
55 entries reside.
56 If not defined, the suffix of the database is used.
57 .HP
58 .hy 0
59 .B retcode\-item <RDN> <errCode> [op=<oplist>] [text=<message>]
60 .B [ref=<referral>] [sleeptime=<sec>] [matched=<DN>]
61 .RS
62 A dynamically generated entry, located below \fBretcode\-parent\fP.
63 The \fB<errCode>\fP is the number of the response code;
64 it can be in any format supported by strtol.
65 The optional \fB<oplist>\fP is a list of operations that cause
66 response code generation; if absent, all operations are affected.
67 The \fBmatched\fP field is the matched DN that is returned
68 along with the error.
69 The \fBref\fP field is only allowed for the \fBreferral\fP 
70 response code.
71 .RE
72 .TP
73 .B retcode\-indir
74 Enables exploitation of in-directory stored errAbsObject.
75 May result in a lot of unnecessary overhead.
76
77 .SH SCHEMA
78 The
79 .B retcode
80 overlay utilizes the "return code" schema described herein. 
81 This schema is specifically designed for use with this
82 overlay and is not intended to be used otherwise.
83 It is also noted that the schema describe here is
84 .I a work in
85 .IR progress ,
86 and hence subject to change without notice.
87 The schema is loaded automatically by the overlay.
88
89 The schema includes a number of object classes and associated
90 attribute types as described below.
91
92 .LP
93 The error code:
94 .RS 4
95 (  1.3.6.1.4.1.4203.666.11.4.1.1
96     NAME ( 'errCode' )
97     DESC 'LDAP error code'
98     EQUALITY integerMatch
99     ORDERING integerOrderingMatch
100     SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
101     SINGLE-VALUE )
102 .RE
103 .LP
104 The operations that trigger the response code:
105 .RS 4
106 ( 1.3.6.1.4.1.4203.666.11.4.1.2
107     NAME ( 'errOp' )
108     DESC 'Operations the errObject applies to'
109     EQUALITY caseIgnoreMatch
110     SUBSTR caseIgnoreSubstringsMatch
111     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
112 .RE
113 .LP
114 The text message:
115 .RS 4
116 ( 1.3.6.1.4.1.4203.666.11.4.1.3
117     NAME ( 'errText' )
118     DESC 'LDAP error textual description'
119     EQUALITY caseIgnoreMatch
120     SUBSTR caseIgnoreSubstringsMatch
121     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
122     SINGLE-VALUE )
123 .RE
124 .LP
125 The sleep time before the response is actually returned to the client:
126 .RS 4
127 ( 1.3.6.1.4.1.4203.666.11.4.1.4
128     NAME ( 'errSleepTime' )
129     DESC 'Time to wait before returning the error'
130     EQUALITY integerMatch
131     SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
132     SINGLE-VALUE )
133 .RE
134 .LP
135 The matched DN returned to the client:
136 .RS 4
137 ( 1.3.6.1.4.1.4203.666.11.4.1.5
138     NAME ( 'errMatchedDN' )
139     DESC 'Value to be returned as matched DN'
140     EQUALITY distinguishedNameMatch
141     SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
142     SINGLE-VALUE )
143 .RE
144 .LP
145 The abstract class that triggers the overlay:
146 .RS 4
147 ( 1.3.6.1.4.1.4203.666.11.4.3.0
148     NAME ( 'errAbsObject' )
149     SUP top ABSTRACT
150     MUST ( errCode )
151     MAY ( cn $ description $ errOp $ errText $ errSleepTime
152         $ errMatchedDN ) )
153 .RE
154 .LP
155 The standalone structural objectclass for specifically created data:
156 .RS 4
157 ( 1.3.6.1.4.1.4203.666.11.4.3.1
158     NAME ( 'errObject' )
159     SUP errAbsObject STRUCTURAL )
160 .RE
161 .LP
162 The auxiliary objectclass to alter the behavior of existing objects:
163 .RS 4
164 ( 1.3.6.1.4.1.4203.666.11.4.3.2
165     NAME ( 'errAuxObject' )
166     SUP errAbsObject AUXILIARY )
167 .RE
168
169 .SH EXAMPLE
170 .LP
171 .RS
172 .nf
173 overlay         retcode
174 retcode-parent  "ou=RetCodes,dc=example,dc=com"
175 include         ./retcode.conf
176
177 # Wait 10 seconds, then return success (0x00)
178 retcode-item    "cn=Success after 10 seconds" 0x00 sleeptime=10
179 # Wait 10 seconds, then return timelimitExceeded (0x03)
180 retcode-item    "cn=Timelimit after 10 seconds" 0x03 sleeptime=10
181 .fi
182 .RE
183 .LP
184 .LP
185
186 .SH FILES
187 .TP
188 ETCDIR/slapd.conf
189 default slapd configuration file
190 .SH SEE ALSO
191 .BR slapd.conf (5),
192 .BR slapd (8),
193 .SH ACKNOWLEDGEMENTS
194 .P
195 This module was written in 2005 by Pierangelo Masarati for SysNet s.n.c.