3 LDAPEXT Working Group J. Sermersheim
4 Internet Draft Novell, Inc
5 Document: draft-ietf-ldapext-ldapv3-dupent-08.txt Sept 2002
6 Intended Category: Standard Track
9 LDAP Control for a Duplicate Entry Representation of Search Results
12 1. Status of this Memo
14 This document is an Internet-Draft and is in full conformance with
15 all provisions of Section 10 of RFC2026 [1].
17 Internet-Drafts are working documents of the Internet Engineering
18 Task Force (IETF), its areas, and its working groups. Note that
19 other groups may also distribute working documents as Internet-
20 Drafts. Internet-Drafts are draft documents valid for a maximum of
21 six months and may be updated, replaced, or obsoleted by other
22 documents at any time. It is inappropriate to use Internet- Drafts
23 as reference material or to cite them other than as "work in
26 The list of current Internet-Drafts can be accessed at
27 http://www.ietf.org/ietf/1id-abstracts.txt
29 The list of Internet-Draft Shadow Directories can be accessed at
30 http://www.ietf.org/shadow.html.
34 This document describes a Duplicate Entry Representation control
35 extension for the LDAP Search operation. By using the control with
36 an LDAP search, a client requests that the server return separate
37 entries for each value held in the specified attribute(s). For
38 instance, if a specified attribute of an entry holds multiple
39 values, the search operation will return multiple instances of that
40 entry, each instance holding a separate single value in that
45 This document describes controls, which allow duplicate entries to
46 be returned in the result set of search operation. Each duplicated
47 entry represents a distinct value (or combination of values) of the
48 set of specified multi-valued attributes.
50 For example, an application may need to produce an ordered list of
51 entries, sorted by a multi-valued attribute, where each attribute
52 value is represented in the list. The Server-Side Sorting control
53 [RFC2891] allows the server to order search result entries based on
54 attribute values (sort keys). But it does not allow one to specify
55 behavior when an attribute contains multiple values. The default
58 Sermersheim Internet-Draft - Expires Mar 2003 Page 1
\f
59 LDAP Control for a Duplicate Entry Representation of Search Results
62 behavior, as outlined in 7.9 of [X.511], is to use the smallest
63 order value as the sort key.
65 In order to produce an ordered list, where each value of a multi-
66 valued attribute is sorted into the list, a separate control is
67 needed which causes the set of entries to be expanded sufficiently
68 to represent each attribute value prior to sorting.
72 An example of this would be a sorted list of all telephone numbers
73 in an organization. Because any entry may have multiple telephone
74 numbers, and the list is to be sorted by telephone number, the list
75 must be able to contain duplicate entries, each with its own unique
78 Another example would be an application that needs to display an
79 ordered list of all members of a group. It would use this control
80 to create a result set of duplicate groupOfNames entries, each with
81 a single, unique value in its member attribute.
85 The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY"
86 used in this document carry the meanings described in [RFC2119].
88 All controlValue data is represented as ASN.1 in this document, and
89 is to be BER encoded as stated in Section 5.1 of [RFC2251].
93 Support for the controls is advertised by the presence of their OID
94 in the supportedControl attribute of a server's root DSE. The OID
95 for the request control is "2.16.840.1.113719.1.27.101.1" and the
96 OIDs for the response controls are "2.16.840.1.113719.1.27.101.2"
97 and "2.16.840.1.113719.1.27.101.3".
101 This control is included in the searchRequest message as part of the
102 controls field of the LDAPMessage, as defined in Section 4.1.12 of
105 The controlType is set to "2.16.840.1.113719.1.27.101.1". The
106 criticality MAY be set to either TRUE or FALSE. The controlValue is
107 defined as the following DuplicateEntryRequest:
109 DuplicateEntryRequest ::= SEQUENCE {
110 AttributeDescriptionList, -- from [RFC2251]
111 PartialApplicationAllowed BOOLEAN DEFAULT TRUE }
114 5.1.1 AttributeDescriptionList Semantics
116 Sermersheim Internet-Draft - Expires Mar 2003 Page 2
\f
117 LDAP Control for a Duplicate Entry Representation of Search Results
121 The AttributeDescriptionList data type is described in 4.1.5 of
122 [RFC2251] and describes a list of zero or more AttributeDescription
123 types as also described in 4.1.5 of [RFC2251]. Both definitions are
124 repeated here for convenience:
126 AttributeDescriptionList ::= SEQUENCE OF
129 AttributeDescription ::= LDAPString
131 A value of AttributeDescription is based on the following BNF:
133 attributeDescription = AttributeType [ ";" <options> ]
135 While processing a search request, a server implementation examines
136 this list. If a specified attribute or attribute subtype exists in
137 an entry to be returned by the search operation, and that attribute
138 holds multiple values, the server treats the entry as if it were
139 multiple, duplicate entries -- the specified attributes each holding
140 a single, unique value from the original set of values of that
141 attribute. Note that this may result in search result entries that
142 no longer match the search filter.
144 Specifying an attribute supertype has the effect of treating all
145 values of that attribute's subtypes as if they were values of the
146 specified attribute supertype. See Section 6.2 for an example of
149 When attribute descriptions contain subtyping options, they are
150 treated in the same manner as is described in Section 4.1.5 of
151 [RFC2251]. Semantics are undefined if an attribute description
152 contains a non-subtyping option, and SHOULD NOT be specified by
155 When two or more attributes are specified by this control, the
156 number of duplicate entries is the combination of all values in each
157 attribute. Because of the potential complexity involved in servicing
158 multiple attributes, server implementations MAY choose to support a
159 limited number of attributes in the control.
161 There is a special case where either no attributes are specified, or
162 an attribute description value of "*" is specified. In this case,
163 all attributes are used. (The "*" allows the client to request all
164 user attributes in addition to specific operational attributes).
166 If an attribute is unrecognized, that attribute is ignored when
167 processing the control.
169 5.1.2 PartialApplicationAllowed Semantics
171 The PartialApplicationAllowed field is used to specify whether the
172 client will allow the server to apply this control to a subset of
174 Sermersheim Internet-Draft - Expires Mar 2003 Page 3
\f
175 LDAP Control for a Duplicate Entry Representation of Search Results
178 the search result set. If TRUE, the server is free to arbitrarily
179 apply this control to no, any, or all search results. If FALSE, the
180 server MUST either apply the control to all search results or fail
181 to support the control at all.
183 Client implementations use the DuplicateSearchResult control to
184 discover which search results have been affected by this control.
186 5.2 Response Controls
188 Two response controls are defined to provide feedback while the
189 search results are being processed; DuplicateSearchResult and
190 DuplicateEntryResponseDone.
192 The DuplicateSearchResult control is sent with all SearchResultEntry
193 operations that contain search results which have been modified by
194 the DuplicateEntryRequest control.
196 The DuplicateEntryResponseDone control is sent with the
197 SearchResultDone operation in order to convey completion
200 5.2.1 The DuplicateSearchResult control
202 This control is included in the SearchResultEntry message of any
203 search result that holds an entry that has been modified by the
204 DuplicateEntryRequest control as part of the controls field of the
205 LDAPMessage, as defined in Section 4.1.12 of [RFC2251]. This control
206 is absent on search results that are unaffected by
207 DuplicateEntryRequest control.
209 The controlType is set to "2.16.840.1.113719.1.27.101.2". The
210 controlValue is not included.
212 5.2.2 The DuplicateEntryResponseDone control
214 This control is included in the searchResultDone message as part of
215 the controls field of the LDAPMessage, as defined in Section 4.1.12
218 The controlType is set to "2.16.840.1.113719.1.27.101.3". The
219 controlValue is defined as the following DuplicateEntryResponseDone:
221 DuplicateEntryResponseDone ::= SEQUENCE {
222 resultCode, -- From [RFC2251]
223 errorMessage [0] LDAPString OPTIONAL,
224 attribute [1] AttributeDescription OPTIONAL }
226 A resultCode field is provided here to allow the server to convey to
227 the client that an error resulted due to the control being serviced.
228 For example, a search that would ordinarily complete successfully
229 may fail with a sizeLimitExceeded error due to this control being
232 Sermersheim Internet-Draft - Expires Mar 2003 Page 4
\f
233 LDAP Control for a Duplicate Entry Representation of Search Results
236 processed. If the operation is successfull, the value will be
239 The errorMessage field MAY be populated with a human-readable string
240 in the event of an erroneous result code.
242 The attribute field MAY be set to the value of the first attribute
243 specified by the DuplicateEntryRequest that was in error. The
244 client MUST ignore the attribute field if the result is success.
250 This example will show this control being used to produce a list of
251 all telephone numbers in the dc=example,dc=net container. Let's say
252 the following three entries exist in this container;
254 dn: cn=User1,dc=example,dc=net
255 telephoneNumber: 555-0123
257 dn: cn=User2,dc=example,dc=net
258 telephoneNumber: 555-8854
259 telephoneNumber: 555-4588
260 telephoneNumber: 555-5884
262 dn: cn=User3,dc=example,dc=net
263 telephoneNumber: 555-9425
264 telephoneNumber: 555-7992
266 First an LDAP search is specified with a baseDN of
267 "dc=example,dc=net", subtree scope, filter set to
268 "(telephoneNumber=*)". A DuplicateEntryRequest control is attached
269 to the search, specifying "telephoneNumber" as the attribute
270 description, and the search request is sent to the server.
272 The set of search results returned by the server would then consist
273 of the following entries:
275 dn: cn=User1,dc=example,dc=net
276 telephoneNumber: 555-0123
277 <no DuplicateSearchResult control sent with search result>
279 dn: cn=User2,dc=example,dc=net
280 telephoneNumber: 555-8854
281 control: 2.16.840.1.113719.1.27.101.2
283 dn: cn=User2,dc=example,dc=net
284 telephoneNumber: 555-4588
285 control: 2.16.840.1.113719.1.27.101.2
287 dn: cn=User2,dc=example,dc=net
288 telephoneNumber: 555-5884
290 Sermersheim Internet-Draft - Expires Mar 2003 Page 5
\f
291 LDAP Control for a Duplicate Entry Representation of Search Results
294 control: 2.16.840.1.113719.1.27.101.2
296 dn: cn=User3,dc=example,dc=net
297 telephoneNumber: 555-9425
298 control: 2.16.840.1.113719.1.27.101.2
300 dn: cn=User3,dc=example,dc=net
301 telephoneNumber: 555-7992
302 control: 2.16.840.1.113719.1.27.101.2
304 All but the first entry are accompanied by the DuplicateSearchResult
305 control when sent from the server.
307 Note that it is not necessary to use an attribute in this control
308 that is specified in the search filter. This example only does so,
309 because the result was to obtain a list of telephone numbers.
311 6.2 Specifying multiple attributes
313 A more complicated example involving multiple attributes will result
314 in more entries. If we assume these entries in the directory:
316 dn: cn=User1,dc=example,dc=net
319 mail: user1@example.net
321 dn: cn=User2,dc=example,dc=net
324 mail: user2@example.net
325 mail: usertwo@example.net
327 In this example, we specify mail and name in the attribute list. By
328 specifying name, all attribute subtypes of name will also be
329 considered. Following is the resulting set of entries:
331 dn: cn=User1,dc=example,dc=net
333 mail: user1@example.net
334 control: 2.16.840.1.113719.1.27.101.2
336 dn: cn=User1,dc=example,dc=net
338 mail: user1@example.net
339 control: 2.16.840.1.113719.1.27.101.2
341 dn: cn=User2,dc=example,dc=net
343 mail: user2@example.net
344 control: 2.16.840.1.113719.1.27.101.2
346 dn: cn=User2,dc=example,dc=net
348 Sermersheim Internet-Draft - Expires Mar 2003 Page 6
\f
349 LDAP Control for a Duplicate Entry Representation of Search Results
353 mail: usertwo@example.net
354 control: 2.16.840.1.113719.1.27.101.2
356 dn: cn=User2,dc=example,dc=net
358 mail: user2@example.net
359 control: 2.16.840.1.113719.1.27.101.2
361 dn: cn=User2,dc=example,dc=net
363 mail: usertwo@example.net
364 control: 2.16.840.1.113719.1.27.101.2
366 6.3 Listing the members of a groupOfNames
368 This example shows how the controls can be used to turn a single
369 groupOfNames entry into multiple duplicate entries. Let's say this
370 is our groupOfNames entry:
372 dn: cn=Administrators,dc=example,dc=net
374 member: cn=aBaker,dc=example,dc=net
375 member: cn=cDavis,dc=example,dc=net
376 member: cn=bChilds,dc=example,dc=net
377 member: cn=dEvans,dc=example,dc=net
379 We could set our search base to "cn=Administrators,dc=example,dc=net
380 ", filter to "(objectClass=*)", use an object scope (to restrict it
381 to this entry) and send the duplicateEntryRequest control with
382 "member" as its attribute value. The resulting set would look like
385 dn: cn=Administrators,dc=example,dc=net
386 member: cn=aBaker,dc=example,dc=net
387 control: 2.16.840.1.113719.1.27.101.2
389 dn: cn=Administrators,dc=example,dc=net
390 member: cn=cDavis,dc=example,dc=net
391 control: 2.16.840.1.113719.1.27.101.2
393 dn: cn=Administrators,dc=example,dc=net
394 member: cn=bChilds,dc=example,dc=net
395 control: 2.16.840.1.113719.1.27.101.2
397 dn: cn=Administrators,dc=example,dc=net
398 member: cn=dEvans,dc=example,dc=net
399 control: 2.16.840.1.113719.1.27.101.2
401 This list can then be sorted by member and displayed (also by
404 7. Relationship to other controls
406 Sermersheim Internet-Draft - Expires Mar 2003 Page 7
\f
407 LDAP Control for a Duplicate Entry Representation of Search Results
411 This control is intended (but not limited) to be used with the
412 Server Side Sorting control [RFC2891]. By pairing this control with
413 the Server Side Sorting control, One can produce a set of entries,
414 sorted by attribute values, where each attribute value is
415 represented in the sorted set. Server implementations MUST ensure
416 that this control is processed before sorting the result of a
417 search, as this control alters the result set of search.
419 This control MAY also be used with the Virtual List View [VLV]
420 control (which has a dependency on the Server Side Sort control).
421 The nature of the dependency between the VLV control and the Sort
422 control is such that the Sorting takes place first. Because the sort
423 happens first, and because this control is processed before the sort
424 control, the impact of this control on the VLV control is minimal.
425 Some server implementations may need to carefully consider how to
426 handle the typedown functionality of the VLV control when paired
427 with this control. The details of this are heavily implementation
428 dependent and are beyond the scope of this document.
430 8. Notes for Implementers
432 Both client and server implementations MUST be aware that using this
433 control could potentially result in a very large set of search
434 results. Servers MAY return an adminLimitExceeded result in the
435 response control due to inordinate consumption of resources. This
436 may be due to some a priori knowledge such as a server restriction
437 of the number of attributes in the request control that it's willing
438 to service, or it may be due to the server attempting to service the
439 control and running out of resources.
441 Client implementations MUST be aware that when using this control,
442 search entries returned will contain a subset of the values of any
445 If this control is used in a chained environment, servers SHOULD NOT
446 pass this control to other servers. Instead they SHOULD gather
447 results and apply this control themselves.
449 9. Security Considerations
451 This control allows finer control of the result set returned by an
452 LDAP search operation and as such may be used in a denial of service
453 attack. See Section 8 for more information on how this is detected
458 The author gratefully thanks the input and support of participants
459 of the LDAP-EXT working group.
464 Sermersheim Internet-Draft - Expires Mar 2003 Page 8
\f
465 LDAP Control for a Duplicate Entry Representation of Search Results
469 Wahl, M, S. Kille and T. Howes, "Lightweight Directory Access
470 Protocol (v3)", Internet RFC, December, 1997.
471 Available as RFC 2251.
474 Wahl, M, A. Herron and T. Howes, "LDAP Control Extension for Server
475 Side Sorting of Search Results", Internet RFC, August, 2000.
476 Available as RFC 2891.
479 Boreham, D, Sermersheim, J, Anantha, A, Armijo, M, "LDAP Extensions
480 for Scrolling View Browsing of Search Results", Internet Draft,
482 Available as draft-ietf-ldapext-ldapv3-vlv-xx.txt.
485 ITU-T Rec. X.511, "The Directory: Abstract Service Definition",
489 Bradner, Scott, "Key Words for use in RFCs to Indicate Requirement
490 Levels", Internet Draft, March, 1997.
491 Available as RFC 2119.
497 1800 South Novell Place
498 Provo, Utah 84606, USA
522 Sermersheim Internet-Draft - Expires Mar 2003 Page 9
\f