2006-11-16 07:49:04 +08:00
|
|
|
.TH SLAPO-RETCODE 5 "RELEASEDATE" "OpenLDAP LDVERSION"
|
2009-01-22 08:40:04 +08:00
|
|
|
.\" Copyright 1998-2009 The OpenLDAP Foundation, All Rights Reserved.
|
2005-06-20 06:39:44 +08:00
|
|
|
.\" Copying restrictions apply. See the COPYRIGHT file.
|
|
|
|
.\" Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
|
2005-07-04 14:57:10 +08:00
|
|
|
.\" $OpenLDAP$
|
2005-06-20 06:39:44 +08:00
|
|
|
.SH NAME
|
2009-06-03 08:43:44 +08:00
|
|
|
slapo\-retcode \- return code overlay to slapd
|
2005-06-20 06:39:44 +08:00
|
|
|
.SH SYNOPSIS
|
|
|
|
ETCDIR/slapd.conf
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
|
|
|
.B retcode
|
|
|
|
overlay to
|
|
|
|
.BR slapd (8)
|
2005-07-04 14:57:10 +08:00
|
|
|
is useful to test the behavior of clients when server-generated erroneous
|
2005-06-20 06:39:44 +08:00
|
|
|
and/or unusual responses occur, e.g. error codes, referrals,
|
|
|
|
excessive response times and so on.
|
|
|
|
|
|
|
|
The error responses are generated according to different strategies.
|
|
|
|
.LP
|
|
|
|
In the first case, all operations targeted at a specific configurable
|
|
|
|
subtree cause the object related to the request DN to be looked up
|
|
|
|
and checked for return code data: a response code, plus an optional
|
2005-11-07 07:26:42 +08:00
|
|
|
textual message, an optional configurable delay, an optional matched DN
|
|
|
|
field, and, when the response code is "referral", a (list of) referral(s).
|
2005-06-20 06:39:44 +08:00
|
|
|
.LP
|
|
|
|
Well-known response codes from standard track documents are provided
|
|
|
|
in \fBretcode.conf\fP, which can be included after instantiating
|
|
|
|
the overlay.
|
|
|
|
.LP
|
2005-08-21 02:01:40 +08:00
|
|
|
In the second case, objects of classes inherited from
|
|
|
|
the \fBerrAbsObject\fP, like \fBerrObject\fP or \fBerrAuxObject\fP,
|
|
|
|
when returned as intermediate responses of a search request, are changed
|
|
|
|
into the response dictated by their content.
|
2005-06-20 06:39:44 +08:00
|
|
|
.LP
|
|
|
|
A third mode causes objects to be looked up from the underlying database
|
2005-08-21 02:01:40 +08:00
|
|
|
to discover if their class inherits from \fBerrABsObject\fP;
|
2005-08-20 19:39:08 +08:00
|
|
|
in that case, their content is used to compute the corresponding response.
|
2005-06-20 06:39:44 +08:00
|
|
|
.LP
|
|
|
|
The behavior is disabled by using the \fBmanageDSAit\fP control (RFC 3296);
|
|
|
|
in that case, the resulting object, either present in the directory
|
|
|
|
or dynamically generated by the overlay, or contained in the request,
|
|
|
|
is handled as usual.
|
|
|
|
.LP
|
|
|
|
The config directives that are specific to the
|
|
|
|
.B retcode
|
|
|
|
overlay must be prefixed by
|
|
|
|
.BR retcode\- ,
|
|
|
|
to avoid conflicts with directives specific to the underlying database
|
|
|
|
or to other stacked overlays. The following specific directives
|
|
|
|
can be used to configure the retcode overlay:
|
|
|
|
.TP
|
|
|
|
.B retcode\-parent <DN>
|
|
|
|
This directive defines the parent DN where dynamically generated
|
|
|
|
entries reside.
|
|
|
|
If not defined, the suffix of the database is used.
|
|
|
|
.HP
|
|
|
|
.hy 0
|
|
|
|
.B retcode\-item <RDN> <errCode> [op=<oplist>] [text=<message>]
|
2005-11-07 07:26:42 +08:00
|
|
|
.B [ref=<referral>] [sleeptime=<sec>] [matched=<DN>]
|
2009-06-03 08:43:44 +08:00
|
|
|
.B [unsolicited=<OID>[:<data>]] [flags=[{pre|post}\-]disconnect[,...]]
|
2005-06-20 06:39:44 +08:00
|
|
|
.RS
|
|
|
|
A dynamically generated entry, located below \fBretcode\-parent\fP.
|
2007-01-05 03:58:29 +08:00
|
|
|
The \fBerrCode\fP is the number of the response code;
|
|
|
|
it can be in any format supported by
|
|
|
|
.BR strtol (3).
|
|
|
|
The optional \fBoplist\fP is a list of operations that cause
|
2005-06-20 06:39:44 +08:00
|
|
|
response code generation; if absent, all operations are affected.
|
2005-11-07 07:26:42 +08:00
|
|
|
The \fBmatched\fP field is the matched DN that is returned
|
2007-01-05 03:58:29 +08:00
|
|
|
along with the error, while the \fBtext\fP field is an optional
|
|
|
|
diagnostics message.
|
2005-06-20 06:39:44 +08:00
|
|
|
The \fBref\fP field is only allowed for the \fBreferral\fP
|
|
|
|
response code.
|
2007-01-05 03:58:29 +08:00
|
|
|
The \fBsleeptime\fP field causes
|
|
|
|
.BR slapd (8)
|
|
|
|
to sleep the specified number of seconds before proceeding
|
|
|
|
with the operation.
|
|
|
|
The \fBunsolicited\fP field can be used to cause the return
|
|
|
|
of an RFC 4511 unsolicited response message; if \fBOID\fP
|
|
|
|
is not "0", an extended response is generated, with the optional
|
|
|
|
\fBdata\fP appended.
|
2009-06-03 08:43:44 +08:00
|
|
|
If \fBflags\fP contains \fBdisconnect\fP, or \fBpre\-disconnect\fP,
|
2007-01-05 04:17:53 +08:00
|
|
|
.BR slapd (8)
|
2009-06-03 08:43:44 +08:00
|
|
|
disconnects abruptly, without notice; \fBpost\-disconnect\fP
|
2007-01-06 00:18:42 +08:00
|
|
|
causes disconnection right after sending response as appropriate.
|
2005-06-20 06:39:44 +08:00
|
|
|
.RE
|
|
|
|
.TP
|
|
|
|
.B retcode\-indir
|
2005-08-21 02:01:40 +08:00
|
|
|
Enables exploitation of in-directory stored errAbsObject.
|
2005-08-20 19:39:08 +08:00
|
|
|
May result in a lot of unnecessary overhead.
|
2006-03-31 07:49:51 +08:00
|
|
|
.TP
|
2009-06-03 08:43:44 +08:00
|
|
|
.B retcode\-sleep [\-]<n>
|
2006-03-31 07:49:51 +08:00
|
|
|
Defines a sleep time in seconds that is spent before actually handling
|
|
|
|
any operation.
|
|
|
|
If negative, a random time between 0 and the absolute value of the argument
|
|
|
|
is used.
|
2005-06-20 06:39:44 +08:00
|
|
|
|
|
|
|
.SH SCHEMA
|
2005-11-02 04:33:15 +08:00
|
|
|
The
|
|
|
|
.B retcode
|
|
|
|
overlay utilizes the "return code" schema described herein.
|
|
|
|
This schema is specifically designed for use with this
|
|
|
|
overlay and is not intended to be used otherwise.
|
2008-07-11 19:43:34 +08:00
|
|
|
It is also noted that the schema described here is
|
2005-11-02 04:33:15 +08:00
|
|
|
.I a work in
|
|
|
|
.IR progress ,
|
|
|
|
and hence subject to change without notice.
|
|
|
|
The schema is loaded automatically by the overlay.
|
|
|
|
|
|
|
|
The schema includes a number of object classes and associated
|
|
|
|
attribute types as described below.
|
|
|
|
|
2005-06-20 06:39:44 +08:00
|
|
|
.LP
|
|
|
|
The error code:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.1
|
|
|
|
NAME ( 'errCode' )
|
|
|
|
DESC 'LDAP error code'
|
|
|
|
EQUALITY integerMatch
|
|
|
|
ORDERING integerOrderingMatch
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2005-06-20 06:39:44 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
|
|
|
The operations that trigger the response code:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.2
|
|
|
|
NAME ( 'errOp' )
|
|
|
|
DESC 'Operations the errObject applies to'
|
|
|
|
EQUALITY caseIgnoreMatch
|
|
|
|
SUBSTR caseIgnoreSubstringsMatch
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
|
|
|
|
.RE
|
|
|
|
.LP
|
|
|
|
The text message:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.3
|
|
|
|
NAME ( 'errText' )
|
|
|
|
DESC 'LDAP error textual description'
|
|
|
|
EQUALITY caseIgnoreMatch
|
|
|
|
SUBSTR caseIgnoreSubstringsMatch
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2005-06-20 06:39:44 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
|
|
|
The sleep time before the response is actually returned to the client:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.4
|
|
|
|
NAME ( 'errSleepTime' )
|
|
|
|
DESC 'Time to wait before returning the error'
|
|
|
|
EQUALITY integerMatch
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2005-06-20 06:39:44 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
2005-11-07 07:26:42 +08:00
|
|
|
The matched DN returned to the client:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.5
|
|
|
|
NAME ( 'errMatchedDN' )
|
|
|
|
DESC 'Value to be returned as matched DN'
|
|
|
|
EQUALITY distinguishedNameMatch
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2005-11-07 07:26:42 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
2007-01-05 03:58:29 +08:00
|
|
|
The OID to be returned as extended response OID
|
|
|
|
in RFC 4511 unsolicited responses
|
|
|
|
("0" generates a regular response with msgid set to 0):
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.6
|
|
|
|
NAME ( 'errUnsolicitedOID' )
|
|
|
|
DESC 'OID to be returned within unsolicited response'
|
|
|
|
EQUALITY objectIdentifierMatch
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2007-01-05 03:58:29 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
|
|
|
The octet string to be returned as extended response data
|
|
|
|
in RFC 4511 unsolicited response:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.7
|
|
|
|
NAME ( 'errUnsolicitedData' )
|
|
|
|
DESC 'Data to be returned within unsolicited response'
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2007-01-05 03:58:29 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
2007-01-05 04:17:53 +08:00
|
|
|
If TRUE,
|
|
|
|
.BR slapd (8)
|
2007-01-06 00:18:42 +08:00
|
|
|
disconnects abruptly without notice; if FALSE, it disconnects
|
|
|
|
after sending response as appropriate:
|
2007-01-05 04:17:53 +08:00
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.1.8
|
|
|
|
NAME ( 'errDisconnect' )
|
|
|
|
DESC 'Disconnect without notice'
|
|
|
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
|
2009-06-03 08:43:44 +08:00
|
|
|
SINGLE\-VALUE )
|
2007-01-05 04:17:53 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
2005-08-21 02:01:40 +08:00
|
|
|
The abstract class that triggers the overlay:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.3.0
|
|
|
|
NAME ( 'errAbsObject' )
|
|
|
|
SUP top ABSTRACT
|
|
|
|
MUST ( errCode )
|
2005-11-07 07:26:42 +08:00
|
|
|
MAY ( cn $ description $ errOp $ errText $ errSleepTime
|
|
|
|
$ errMatchedDN ) )
|
2005-08-21 02:01:40 +08:00
|
|
|
.RE
|
|
|
|
.LP
|
2005-08-20 19:39:08 +08:00
|
|
|
The standalone structural objectclass for specifically created data:
|
2005-06-20 06:39:44 +08:00
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.3.1
|
|
|
|
NAME ( 'errObject' )
|
2005-08-21 02:01:40 +08:00
|
|
|
SUP errAbsObject STRUCTURAL )
|
2005-06-20 06:39:44 +08:00
|
|
|
.RE
|
2005-08-20 19:39:08 +08:00
|
|
|
.LP
|
|
|
|
The auxiliary objectclass to alter the behavior of existing objects:
|
|
|
|
.RS 4
|
|
|
|
( 1.3.6.1.4.1.4203.666.11.4.3.2
|
|
|
|
NAME ( 'errAuxObject' )
|
2005-08-21 02:01:40 +08:00
|
|
|
SUP errAbsObject AUXILIARY )
|
2005-08-20 19:39:08 +08:00
|
|
|
.RE
|
2005-06-20 06:39:44 +08:00
|
|
|
|
|
|
|
.SH EXAMPLE
|
|
|
|
.LP
|
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
overlay retcode
|
2009-06-03 08:43:44 +08:00
|
|
|
retcode\-parent "ou=RetCodes,dc=example,dc=com"
|
2008-08-28 06:20:53 +08:00
|
|
|
|
|
|
|
# retcode.conf is found in tests/data/ of the source tree
|
2005-06-20 06:39:44 +08:00
|
|
|
include ./retcode.conf
|
|
|
|
|
|
|
|
# Wait 10 seconds, then return success (0x00)
|
2009-06-03 08:43:44 +08:00
|
|
|
retcode\-item "cn=Success after 10 seconds" 0x00 sleeptime=10
|
2005-06-20 06:39:44 +08:00
|
|
|
# Wait 10 seconds, then return timelimitExceeded (0x03)
|
2009-06-03 08:43:44 +08:00
|
|
|
retcode\-item "cn=Timelimit after 10 seconds" 0x03 sleeptime=10
|
2005-06-20 06:39:44 +08:00
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.LP
|
|
|
|
.LP
|
|
|
|
|
|
|
|
.SH FILES
|
|
|
|
.TP
|
|
|
|
ETCDIR/slapd.conf
|
|
|
|
default slapd configuration file
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR slapd.conf (5),
|
2009-01-30 08:23:58 +08:00
|
|
|
.BR slapd\-config (5),
|
2008-09-19 08:09:56 +08:00
|
|
|
.BR slapd (8).
|
|
|
|
The
|
2009-06-03 08:43:44 +08:00
|
|
|
.BR slapo\-retcode (5)
|
2008-09-19 08:09:56 +08:00
|
|
|
overlay supports dynamic configuration via
|
|
|
|
.BR back-config .
|
2005-08-20 20:20:58 +08:00
|
|
|
.SH ACKNOWLEDGEMENTS
|
|
|
|
.P
|
|
|
|
This module was written in 2005 by Pierangelo Masarati for SysNet s.n.c.
|