]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd.access.5
00ed406810ff0c2193b75ff18f88877b21b96ab9
[openldap] / doc / man / man5 / slapd.access.5
1 .TH SLAPD.ACCESS 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2004 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .SH NAME
5 slapd.access \- access configuration for slapd, the stand-alone LDAP daemon
6 .SH SYNOPSIS
7 ETCDIR/slapd.conf
8 .SH DESCRIPTION
9 The 
10 .BR slapd.conf (5)
11 file contains configuration information for the
12 .BR slapd (8)
13 daemon. This configuration file is also used by the
14 .BR slurpd (8)
15 replication daemon and by the SLAPD tools
16 .BR slapacl (8),
17 .BR slapadd (8),
18 .BR slapauth (8),
19 .BR slapcat (8),
20 .BR slapdn (8),
21 .BR slapindex (8),
22 and
23 .BR slaptest (8).
24 .LP
25 The
26 .B slapd.conf
27 file consists of a series of global configuration options that apply to
28 .B slapd
29 as a whole (including all backends), followed by zero or more database
30 backend definitions that contain information specific to a backend
31 instance.
32 .LP
33 The general format of
34 .B slapd.conf
35 is as follows:
36 .LP
37 .nf
38     # comment - these options apply to every database
39     <global configuration options>
40     # first database definition & configuration options
41     database    <backend 1 type>
42     <configuration options specific to backend 1>
43     # subsequent database definitions & configuration options
44     ...
45 .fi
46 .LP
47 Both the global configuration and each backend-specific section can
48 contain access information.  Backend-specific access control
49 directives are used for those entries that belong to the backend,
50 according to their naming context.  In case no access control
51 directives are defined for a backend or those which are defined are
52 not applicable, the directives from the global configuration section
53 are then used.
54 .LP
55 For entries not held in any backend (such as a root DSE), the
56 directives of the first backend (and any global directives) are
57 used.
58 .LP
59 Arguments that should be replaced by actual text are shown in
60 brackets <>.
61 .SH THE ACCESS DIRECTIVE
62 The structure of the access control directives is
63 .TP
64 .B access to <what> "[ by <who> <access> [ <control> ] ]+"
65 Grant access (specified by 
66 .BR <access> ) 
67 to a set of entries and/or attributes (specified by 
68 .BR <what> ) 
69 by one or more requestors (specified by 
70 .BR <who> ).
71 .SH THE <WHAT> FIELD
72 The field
73 .BR <what>
74 specifies the entity the access control directive applies to.
75 It can have the forms
76 .LP
77 .nf
78         [dn[.<dnstyle>]=]<dnpattern>
79         filter=<ldapfilter>
80         attrs=<attrlist>[ val[.<attrstyle>]=<attrval>]
81 .fi
82 .LP
83 with
84 .LP
85 .nf
86         <dnstyle>={{exact|base(object)}|regex
87                 |one(level)|sub(tree)|children}
88         <attrlist>={<attr>|[{!|@}]<objectClass>}[,<attrlist>]
89         <attrstyle>={{exact|base(object)}|regex
90                 |one(level)|sub(tree)|children}
91 .fi
92 .LP
93 The statement
94 .B dn=<dnpattern>
95 selects the entries based on their naming context.
96 The 
97 .B dn=
98 part is optional.
99 The
100 .B <dnpattern>
101 is a string representation of the entry's DN.
102 The wildcard
103 .B *
104 stands for all the entries, and it is implied if no
105 .B dn
106 form is given.
107 .LP
108 The 
109 .B <dnstyle> 
110 is also optional; however, it is recommended to specify both the 
111 .B dn=
112 and the
113 .B <dnstyle>
114 to avoid ambiguities.
115 .B Base 
116 (synonym of
117 .BR baseObject ),
118 the default,
119 or
120 .B exact 
121 (an alias of 
122 .BR base )
123 indicates the entry whose DN is equal to the
124 .BR <dnpattern> ;
125 .B one
126 (synonym of
127 .BR onelevel )
128 indicates all the entries immediately below the
129 .BR <dnpattern> ,
130 .B sub
131 (synonym of
132 .BR subtree )
133 indicates all entries in the subtree at the
134 .BR <dnpattern> ,
135 .B children
136 indicates all the entries below (subordinate to) the 
137 .BR <dnpattern> .
138 .LP
139 If the
140 .B <dnstyle>
141 qualifier is
142 .BR regex ,
143 then 
144 .B <dnpattern>
145 is a regular expression pattern,
146 as detailed in
147 .BR regex (7),
148 matching a normalized string representation of the entry's DN.
149 The regex form of the pattern does not (yet) support UTF-8.
150 .LP
151 The statement
152 .B filter=<ldapfilter>
153 selects the entries based on a valid LDAP filter as described in RFC 2254.
154 A filter of
155 .B (objectClass=*)
156 is implied if no
157 .B filter
158 form is given.
159 .LP
160 The statement
161 .B attrs=<attrlist>
162 selects the attributes the access control rule applies to.
163 It is a comma-separated list of attribute types, plus the special names
164 .BR entry ,
165 indicating access to the entry itself, and
166 .BR children ,
167 indicating access to the entry's children. ObjectClass names may also
168 be specified in this list, which will affect all the attributes that
169 are required and/or allowed by that objectClass.
170 Actually, names in 
171 .B <attrlist>
172 that are prefixed by
173 .B @
174 are directly treated as objectClass names.  A name prefixed by
175 .B !
176 is also treated as an objectClass, but in this case the access rule
177 affects the attributes that are not required nor allowed 
178 by that objectClass.
179 If no
180 .B attrs
181 form is given, 
182 .B attrs=@extensibleObject
183 is implied, i.e. all attributes are addressed.
184 .LP
185 Using the form
186 .B attrs=<attr> val[.<style>]=<attrval>
187 specifies access to a particular value of a single attribute.
188 In this case, only a single attribute type may be given. A value
189 .B <style>
190 of
191 .B exact
192 (the default) uses the attribute's equality matching rule to compare the
193 value. If the value
194 .B <style>
195 is
196 .BR regex ,
197 the provided value is used as a regular expression pattern.
198 If the attribute has DN syntax, the value
199 .B <style>
200 can be any of
201 .BR base ,
202 .BR onelevel ,
203 .B subtree
204 or
205 .BR children ,
206 resulting in base, onelevel, subtree or children match, respectively.
207 .LP
208 The dn, filter, and attrs statements are additive; they can be used in sequence 
209 to select entities the access rule applies to based on naming context,
210 value and attribute type simultaneously.
211 .SH THE <WHO> FIELD
212 The field
213 .B <who>
214 indicates whom the access rules apply to.
215 Multiple 
216 .B <who>
217 statements can appear in an access control statement, indicating the
218 different access privileges to the same resource that apply to different
219 accessee.
220 It can have the forms
221 .LP
222 .nf
223         *
224         anonymous
225         users
226         self
227
228         dn[.<dnstyle>[,<modifier>]]=<DN>
229         dnattr=<attrname>
230         group[/<objectclass>[/<attrname>]]
231                 [.<groupstyle>]=<group>
232         peername[.<peernamestyle>]=<peername>
233         sockname[.<style>]=<sockname>
234         domain[.<domainstyle>[,<modifier>]]=<domain>
235         sockurl[.<style>]=<sockurl>
236         set[.<setstyle>]=<pattern>
237
238         ssf=<n>
239         transport_ssf=<n>
240         tls_ssf=<n>
241         sasl_ssf=<n>
242
243         aci=<attrname>
244 .fi
245 .LP
246 with
247 .LP
248 .nf
249         <style>={exact|regex|expand}
250         <dnstyle>={{exact|base(object)}|regex
251                 |one(level)|sub(tree)|children}
252         <groupstyle>={exact|expand}
253         <peernamestyle>={<style>|ip|path}
254         <domainstyle>={exact|regex|sub(tree)}
255         <setstyle>={exact|regex}
256         <modifier>={expand}
257 .fi
258 .LP
259 They may be specified in combination.
260 .LP
261 .nf
262 .fi
263 .LP
264 The wildcard
265 .B *
266 refers to everybody.
267 .LP
268 The keyword
269 .B anonymous
270 means access is granted to unauthenticated clients; it is mostly used 
271 to limit access to authentication resources (e.g. the
272 .B userPassword
273 attribute) to unauthenticated clients for authentication purposes.
274 .LP
275 The keyword
276 .B users
277 means access is granted to authenticated clients.
278 .LP
279 The keyword
280 .B self
281 means access to an entry is allowed to the entry itself (e.g. the entry
282 being accessed and the requesting entry must be the same).
283 .LP
284 The statement
285 .B dn=<DN>
286 means that access is granted to the matching DN.
287 The optional style qualifier
288 .B dnstyle
289 allows the same choices of the dn form of the
290 .B <what>
291 field.  In addition, the
292 .B regex
293 style can exploit substring substitution of submatches in the
294 .B <what>
295 dn.regex clause by using the form
296 .BR $<digit> ,
297 with 
298 .B digit
299 ranging from 0 to 9 (where 0 matches the entire string),
300 or the form
301 .BR ${<digit>+} ,
302 for submatches higher than 9.
303 Since the dollar character is used to indicate a substring replacement,
304 the dollar character that is used to indicate match up to the end of
305 the string must be escaped by a second dollar character, e.g.
306 .LP
307 .nf
308     access to dn.regex="^(.+,)?uid=([^,]+),dc=[^,]+,dc=com$"
309         by dn.regex="^uid=$2,dc=[^,]+,dc=com$$" write
310 .fi
311 .LP
312 The style qualifier
313 allows an optional
314 .BR modifier .
315 At present, the only type allowed is 
316 .BR expand ,
317 which causes substring substitution of submatches to take place
318 even if 
319 .B dnstyle
320 is not 
321 .BR regex .
322 Note that the 
323 .B regex 
324 dnstyle in the above example may be of use only if the 
325 .B <by>
326 clause needs to be a regex; otherwise, if the
327 value of the second (from the right)
328 .B dc=
329 portion of the DN in the above example were fixed, the form
330 .LP
331 .nf
332     access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
333         by dn.exact,expand="uid=$2,dc=example,dc=com" write
334 .fi
335 .LP
336 could be used; if it had to match the value in the 
337 .B <what>
338 clause, the form
339 .LP
340 .nf
341     access to dn.regex="^(.+,)?uid=([^,]+),dc=([^,]+),dc=com$"
342         by dn.exact,expand="uid=$2,dc=$3,dc=com" write
343 .fi
344 .LP
345 could be used.
346 .LP
347 Forms of the 
348 .B <what>
349 clause other than regex may provide submatches as well.
350 The 
351 .BR base(object) ,
352 the
353 .BR sub(tree) ,
354 the
355 .BR one(level) ,
356 and the
357 .B children
358 forms provide
359 .B $0
360 as the match of the entire string.
361 The 
362 .BR sub(tree) ,
363 the
364 .BR one(level) ,
365 and the
366 .B children
367 forms also provide
368 .B $1
369 as the match of the rightmost part of the DN as defined in the
370 .B <what>
371 clause.
372 This may be useful, for instance, to provide access to all the 
373 ancestors of a user by defining
374 .LP
375 .nf
376     access to dn.subtree="dc=com"
377         by dn.subtree,expand="$1" read
378 .fi
379 .LP
380 which means that only access to entries that appear in the DN of the
381 .B <by>
382 clause is allowed.
383 .LP
384 It is perfectly useless to give any access privileges to a DN 
385 that exactly matches the
386 .B rootdn
387 of the database the ACLs apply to, because it implicitly
388 possesses write privileges for the entire tree of that database.
389 Actually, access control is bypassed for the
390 .BR rootdn ,
391 to solve the intrinsic chicken-and-egg problem.
392 .LP
393 The statement
394 .B dnattr=<attrname>
395 means that access is granted to requests whose DN is listed in the
396 entry being accessed under the 
397 .B <attrname>
398 attribute.
399 .LP
400 The statement
401 .B group=<group>
402 means that access is granted to requests whose DN is listed
403 in the group entry whose DN is given by
404 .BR <group> .
405 The optional parameters
406 .B <objectclass>
407 and
408 .B <attrname>
409 define the objectClass and the member attributeType of the group entry.
410 The optional style qualifier
411 .B <style>
412 can be
413 .BR expand ,
414 which means that
415 .B <group>
416 will be expanded as a replacement string (but not as a regular expression)
417 according to
418 .BR regex (7),
419 and
420 .BR exact ,
421 which means that exact match will be used.
422 If the style of the DN portion of the
423 .B <what>
424 clause is regex, the submatches are made available according to
425 .BR regex (7);
426 other styles provide limited submatches as discussed above about 
427 the DN form of the 
428 .B <by>
429 clause.
430 .LP
431 For static groups, the specified attributeType must have
432 .B DistinguishedName
433 or
434 .B NameAndOptionalUID
435 syntax. For dynamic groups the attributeType must
436 be a subtype of the
437 .B labeledURI
438 attributeType. Only LDAP URIs of the form
439 .B ldap:///<base>??<scope>?<filter>
440 will be evaluated in a dynamic group, by searching the local server only.
441 .LP
442 The statements
443 .BR peername=<peername> ,
444 .BR sockname=<sockname> ,
445 .BR domain=<domain> ,
446 and
447 .BR sockurl=<sockurl>
448 mean that the contacting host IP (in the form 
449 .BR "IP=<ip>:<port>" )
450 or the contacting host named pipe file name (in the form
451 .B "PATH=<path>"
452 if connecting through a named pipe) for
453 .BR peername ,
454 the named pipe file name for
455 .BR sockname ,
456 the contacting host name for
457 .BR domain ,
458 and the contacting URL for
459 .BR sockurl
460 are compared against
461 .B pattern
462 to determine access.
463 The same
464 .B style
465 rules for pattern match described for the
466 .B group
467 case apply, plus the
468 .B regex
469 style, which implies submatch
470 .B expand
471 and
472 .BR regex (7)
473 match of the corresponding connection parameters.
474 The
475 .B exact
476 style of the
477 .BR <peername>
478 clause (the default) implies a case-exact match on the client's
479 .BR IP , 
480 including the
481 .B "IP="
482 prefix and the trailing
483 .BR ":<port>" , 
484 or the client's 
485 .BR path ,
486 including the
487 .B "PATH="
488 prefix if connecting through a named pipe.
489 The special
490 .B ip
491 style interprets the pattern as 
492 .BR <peername>=<ip>[%<mask>][{<n>}] ,
493 where
494 .B <ip>
495 and 
496 .B <mask>
497 are dotted digit representations of the IP and the mask, while
498 .BR <n> ,
499 delimited by curly brackets, is an optional port.
500 When checking access privileges, the IP portion of the
501 .BR peername 
502 is extracted, eliminating the
503 .B "IP="
504 prefix and the
505 .B ":<port>"
506 part, and it is compared against the
507 .B <ip>
508 portion of the pattern after masking with
509 .BR <mask> .
510 As an example, 
511 .B peername.ip=127.0.0.1
512 allows connections only from localhost,
513 .B peername.ip=192.168.1.0%255.255.255.0 
514 allows connections from any IP in the 192.168.1 class C domain, and
515 .B peername.ip=192.168.1.16%255.255.255.240{9009}
516 allows connections from any IP in the 192.168.1.[16-31] range 
517 of the same domain, only if port 9009 is used.
518 The special 
519 .B path
520 style eliminates the 
521 .B "PATH="
522 prefix from the 
523 .B peername
524 when connecting through a named pipe, and performs an exact match 
525 on the given pattern.
526 The
527 .BR <domain>
528 clause also allows the
529 .B subtree
530 style, which succeeds when a fully qualified name exactly matches the
531 .BR domain
532 pattern, or its trailing part, after a 
533 .BR dot ,
534 exactly matches the 
535 .BR domain
536 pattern.
537 The 
538 .B expand
539 style is allowed, implying an
540 .B exact 
541 match with submatch expansion; the use of 
542 .B expand 
543 as a style modifier is considered more appropriate.
544 As an example,
545 .B domain.subtree=example.com
546 will match www.example.com, but will not match www.anotherexample.com.
547 The
548 .B domain
549 of the contacting host is determined by performing a DNS reverse lookup.
550 As this lookup can easily be spoofed, use of the
551 .B domain
552 statement is strongly discouraged.  By default, reverse lookups are disabled.
553 The optional
554 .B domainstyle
555 qualifier of the
556 .B <domain>
557 clause allows a
558 .B modifier
559 option; the only value currently supported is
560 .BR expand ,
561 which causes substring substitution of submatches to take place even if
562 the 
563 .B domainstyle
564 is not 
565 .BR regex ,
566 much like the analogous usage in 
567 .B <dn>
568 clause.
569 .LP
570 The statement
571 .B set=<pattern>
572 is undocumented yet.
573 .LP
574 The statement
575 .B aci=<attrname>
576 means that the access control is determined by the values in the
577 .B attrname
578 of the entry itself.
579 ACIs are experimental; they must be enabled at compile time.
580 .LP
581 The statements
582 .BR ssf=<n> ,
583 .BR transport_ssf=<n> ,
584 .BR tls_ssf=<n> ,
585 and
586 .BR sasl_ssf=<n>
587 set the minimum required Security Strength Factor (ssf) needed
588 to grant access.  The value should be positive integer.
589 .SH THE <ACCESS> FIELD
590 The field
591 .B <access> ::= [self]{<level>|<priv>}
592 determines the access level or the specific access privileges the
593 .B who 
594 field will have.
595 Its component are defined as
596 .LP
597 .nf
598         <level> ::= none|auth|compare|search|read|write
599         <priv> ::= {=|+|-}{w|r|s|c|x|0}+
600 .fi
601 .LP
602 The modifier
603 .B self
604 allows special operations like having a certain access level or privilege
605 only in case the operation involves the name of the user that's requesting
606 the access.
607 It implies the user that requests access is bound.
608 An example is the
609 .B selfwrite
610 access to the member attribute of a group, which allows one to add/delete
611 its own DN from the member list of a group, without affecting other members.
612 .LP
613 The 
614 .B level 
615 access model relies on an incremental interpretation of the access
616 privileges.
617 The possible levels are
618 .BR none ,
619 .BR auth ,
620 .BR compare ,
621 .BR search ,
622 .BR read ,
623 and
624 .BR write .
625 Each access level implies all the preceding ones, thus 
626 .B write
627 access will imply all accesses.
628 While
629 .B none
630 is trivial, 
631 .B auth
632 access means that one is allowed access to an attribute to perform
633 authentication/authorization operations (e.g.
634 .BR bind )
635 with no other access.
636 This is useful to grant unauthenticated clients the least possible 
637 access level to critical resources, like passwords.
638 .LP
639 The
640 .B priv
641 access model relies on the explicit setting of access privileges
642 for each clause.
643 The
644 .B =
645 sign resets previously defined accesses; as a consequence, the final 
646 access privileges will be only those defined by the clause.
647 The 
648 .B +
649 and
650 .B -
651 signs add/remove access privileges to the existing ones.
652 The privileges are
653 .B w
654 for write,
655 .B r
656 for read,
657 .B s 
658 for search,
659 .B c 
660 for compare, and
661 .B x
662 for authentication.
663 More than one of the above privileges can be added in one statement.
664 .B 0
665 indicates no privileges and is used only by itself (e.g., +0).
666 .LP
667 The optional field
668 .B <control>
669 controls the flow of access rule application.
670 It can have the forms
671 .LP
672 .nf
673         stop
674         continue
675         break
676 .fi
677 .LP
678 where
679 .BR stop ,
680 the default, means access checking stops in case of match.
681 The other two forms are used to keep on processing access clauses.
682 In detail, the
683 .B continue
684 form allows for other 
685 .B <who>
686 clauses in the same 
687 .B <access>
688 clause to be considered, so that they may result in incrementally altering
689 the privileges, while the
690 .B break
691 form allows for other
692 .B <access>
693 clauses that match the same target to be processed.
694 Consider the (silly) example
695 .LP
696 .nf
697         access to dn.subtree="dc=example,dc=com" attrs=cn
698                 by * =cs break
699
700         access to dn.subtree="ou=People,dc=example,dc=com"
701                 by * +r
702 .fi
703 .LP
704 which allows search and compare privileges to everybody under
705 the "dc=example,dc=com" tree, with the second rule allowing
706 also read in the "ou=People" subtree,
707 or the (even more silly) example
708 .LP
709 .nf
710         access to dn.subtree="dc=example,dc=com" attrs=cn
711                 by * =cs continue
712                 by users +r
713 .fi
714 .LP
715 which grants everybody search and compare privileges, and adds read
716 privileges to authenticated clients.
717 .SH OPERATION REQUIREMENTS
718 Operations require different privileges on different portions of entries.
719 The following summary applies to primary database backends such as
720 the LDBM, BDB, and HDB backends.   Requirements for other backends may
721 (and often do) differ.
722 .LP
723 The
724 .B add
725 operation requires
726 .B write (=w)
727 privileges on the pseudo-attribute 
728 .B entry
729 of the entry being added, and 
730 .B write (=w)
731 privileges on the pseudo-attribute
732 .B children
733 of the entry's parent.
734 .LP
735 The 
736 .B bind
737 operation, when credentials are stored in the directory, requires 
738 .B auth (=x)
739 privileges on the attribute the credentials are stored in (usually
740 .BR userPassword ).
741 .LP
742 The
743 .B compare
744 operation requires 
745 .B compare (=c)
746 privileges on the attribute that is being compared.
747 .LP
748 The
749 .B delete
750 operation requires
751 .B write (=w)
752 privileges on the pseudo-attribute
753 .B entry 
754 of the entry being deleted, and
755 .B write (=w)
756 privileges on the
757 .B children
758 pseudo-attribute of the entry's parent.
759 .LP
760 The
761 .B modify
762 operation requires 
763 .B write (=w)
764 privileges on the attibutes being modified.
765 .LP
766 The
767 .B modrdn
768 operation requires
769 .B write (=w)
770 privileges on the pseudo-attribute
771 .B entry
772 of the entry whose relative DN is being modified,
773 .B write (=w)
774 privileges on the pseudo-attribute
775 .B children
776 of the old and new entry's parents, and
777 .B write (=w)
778 privileges on the attributes that are present in the new relative DN.
779 .B Write (=w)
780 privileges are also required on the attributes that are present 
781 in the old relative DN if 
782 .B deleteoldrdn
783 is set to 1.
784 .LP
785 The
786 .B search
787 operation, for each entry, requires
788 .B search (=s)
789 privileges on the attributes that are defined in the filter.
790 Then, the resulting entries are tested for 
791 .B read (=r)
792 privileges on the pseudo-attribute
793 .B entry
794 (for read access to the entry itself)
795 and for
796 .B read (=r)
797 access on each value of each attribute that is requested.
798 Also, for each
799 .B referral
800 object used in generating continuation references, the operation requires
801 .B read (=r)
802 access on the pseudo-attribute
803 .B entry
804 (for read access to the referral object itself),
805 as well as
806 .B read (=r)
807 access to the attribute holding the referral information
808 (generally the
809 .B ref
810 attribute).
811 .LP
812 Some internal operations and some
813 .B controls
814 require specific access privileges.
815 The
816 .B authzID
817 mapping and the 
818 .B proxyAuthz
819 control require
820 .B auth (=x)
821 privileges on all the attributes that are present in the search filter
822 of the URI regexp maps (the right-hand side of the
823 .B authz-regexp
824 directives).
825 .B Auth (=x)
826 privileges are also required on the
827 .B authzTo
828 attribute of the authorizing identity and/or on the 
829 .B authzFrom
830 attribute of the authorized identity.
831 .SH CAVEATS
832 It is strongly recommended to explicitly use the most appropriate
833 .B <dnstyle>
834 in
835 .B <what>
836 and
837 .B <who>
838 clauses, to avoid possible incorrect specifications of the access rules 
839 as well as for performance (avoid unrequired regex matching when an exact
840 match suffices) reasons.
841 .LP
842 An administrator might create a rule of the form:
843 .LP
844 .nf
845         access to dn.regex="dc=example,dc=com"
846                 by ...
847 .fi
848 .LP
849 expecting it to match all entries in the subtree "dc=example,dc=com".
850 However, this rule actually matches any DN which contains anywhere
851 the substring "dc=example,dc=com".  That is, the rule matches both
852 "uid=joe,dc=example,dc=com" and "dc=example,dc=com,uid=joe".
853 .LP
854 To match the desired subtree, the rule would be more precisely
855 written:
856 .LP
857 .nf
858         access to dn.regex="^(.+,)?dc=example,dc=com$"
859                 by ...
860 .fi
861 .LP
862 For performance reasons, it would be better to use the subtree style.
863 .LP
864 .nf
865         access to dn.subtree="dc=example,dc=com"
866                 by ...
867 .fi
868 .LP
869 When writing submatch rules, it may be convenient to avoid unnecessary
870 .B regex
871 .B <dnstyle>
872 use; for instance, to allow access to the subtree of the user 
873 that matches the
874 .B <what>
875 clause, one could use
876 .LP
877 .nf
878         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
879                 by dn.regex="^uid=$2,dc=example,dc=com$$" write
880                 by ...
881 .fi
882 .LP
883 However, since all that is required in the 
884 .B <by>
885 clause is substring expansion, a more efficient solution is
886 .LP
887 .nf
888         access to dn.regex="^(.+,)?uid=([^,]+),dc=example,dc=com$"
889                 by dn.exact,expand="uid=$2,dc=example,dc=com" write
890                 by ...
891 .fi
892 .LP
893 In fact, while a
894 .B <dnstyle>
895 of
896 .B regex
897 implies substring expansion, 
898 .BR exact ,
899 as well as all the other DN specific
900 .B <dnstyle>
901 values, does not, so it must be explicitly requested.
902 .LP
903 .SH FILES
904 .TP
905 ETCDIR/slapd.conf
906 default slapd configuration file
907 .SH SEE ALSO
908 .BR slapd (8),
909 .BR slapacl (8),
910 .LP
911 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
912 .SH ACKNOWLEDGEMENTS
913 .B OpenLDAP
914 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
915 .B OpenLDAP
916 is derived from University of Michigan LDAP 3.3 Release.