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