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