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