]> git.sur5r.net Git - openldap/blob - doc/guide/admin/slapdconfig.sdf
50031bb554804275d305dae6737cb3c4b299d41c
[openldap] / doc / guide / admin / slapdconfig.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
5 H1: The slapd Configuration File
6
7 Once the software has been built and installed, you are ready to configure it
8 for use at your site. All slapd runtime configuration is accomplished through
9 the {{I:slapd.conf}}(5) file, normally installed in the
10 {{EX:/usr/local/etc/openldap}} directory.
11
12 An alternate configuration file can be specified via a
13 command-line option to slapd or slurpd (see Sections 5 and 8,
14 respectively). This section describes the general format of the config file,
15 followed by a detailed description of each config file directive.
16
17
18
19 H2: Configuration File Format
20
21 The {{slapd.conf}}(5) file consists three types of configuration
22 information: global, backend specific, database specific.  Global
23 information is specified first, followed by information associated
24 with a particular backend type, which is then followed by information
25 associated with a particular database instance.  Global directives can
26 be overridden in a backend and/or database directives, backend directives
27 can be overridden by database directives.
28
29 Blank lines and comment lines beginning with a '{{EX:#}}' character
30 are ignored.  If a line begins with white space, it is considered a
31 continuation of the previous line. The general format of slapd.conf is
32 as follows:
33
34 >       # global configuration directives
35 >       <global config directives>
36 >
37 >       # backend definition
38 >       backend <typeA>
39 >       <backend-specific directives>
40 >
41 >       # first database definition & config directives
42 >       database <typeA>
43 >       <database-specific directives>
44 >
45 >       # second database definition & config directives
46 >       database <typeB>
47 >       <database-specific directives>
48 >
49 >       # second database definition & config directives
50 >       database <typeA>
51 >       <database-specific directives>
52 >
53 >       # subsequent backend & database definitions & config directives
54 >       ...
55
56 A configuration directive may take arguments.  If so, they are
57 separated by white space.  If an argument contains white space,
58 the argument should be enclosed in double quotes {{EX:"like this"}}. If
59 an argument contains a double quote or a backslash character `{{EX:\}}',
60 the character should be preceded by a backslash character `{{EX:\}}'.
61
62 The distribution contains an example configuration file that will
63 be installed in the {{F: /usr/local/etc/openldap}} directory.
64 A number of files containing schema definition (attribute types
65 and object classes) are also provided in the
66 {{F: /usr/local/etc/openldap/schema}} directory.
67
68
69 H2: Configuration File Directives
70
71 This section details commonly used configuration directives.  For
72 a complete list, see {{slapd.conf}}(5) manual page.  This section
73 separates the configuration file directives into global,
74 backend-specific and data-specific categories, describing each
75 directive and its default value (if any), and giving an example of
76 its use.
77
78
79
80 H3: Global Directives
81
82 Directives described in this section apply to all backends,
83 unless specifically overridden in a backend definition. 
84 Arguments to directives should be replaced by actual text are
85 shown in brackets {{EX:<>}}.
86
87
88 H4: access to <what> [ by <who> <accesslevel> <control> ]+
89
90 This directive grants access (specified by <accesslevel>) to a
91 set of entries and/or attributes (specified by <what>) by one or
92 more requesters (specified by <who>). See Section 5.3 on
93 access control for more details and examples.
94
95
96 H4: attributetype <RFC2252 Attribute Type Description>
97
98 This directive defines an attribute type.
99
100 H4: defaultaccess { none | compare | search | read | write }
101
102 This directive specifies the default access to grant requesters
103 not matched by any other access line (see Section 5.3). Note
104 that an access level implies all lesser access levels (e.g.,
105 write access implies read, search and compare).
106
107 \Default:
108
109 E: defaultaccess read
110
111 H4: include <filename>
112
113 This directive specifies that slapd should read additional
114 configuration information from the given file before continuing
115 with the next line of the current file. The included file should
116 follow the normal slapd config file format.
117
118 Note: You should be careful when using this directive - there is
119 no small limit on the number of nested include directives, and no
120 loop detection is done.
121
122 H4: loglevel <integer>
123
124 This directive specifies the level at which debugging statements
125 and operation statistics should be syslogged (currently
126 logged to the {{syslogd}}(8) LOG_LOCAL4 facility). You must
127 have compiled slapd with -DLDAP_DEBUG for this to work
128 (except for the two statistics levels, which are always enabled).
129 Log levels are additive. To display what numbers correspond
130 to what kind of debugging, invoke slapd with the  ? flag or
131 consult the table below. The possible values for <integer> are:
132
133 !block table; colaligns="RL"; align=Center; \
134         title="Table 5.1: Debugging Levels"
135 Level   Description
136 -1      enable all debugging
137 0       no debugging
138 1       trace function calls
139 2       debug packet handling
140 4       heavy trace debugging
141 8       connection management
142 16      print out packets sent and received
143 32      search filter processing
144 64      configuration file processing
145 128     access control list processing
146 256     stats log connections/operations/results
147 512     stats log entries sent
148 1024    print communication with shell backends
149 2048    print entry parsing debugging
150 !endblock
151
152 \Example:
153
154 E: loglevel -1
155
156 This will cause lots and lots of debugging information to be
157 logged.
158
159 \Default:
160
161 E: loglevel 256
162
163 H4: objectclass <RFC2252 Object Class Description>
164
165 This directive defines an object class.
166
167 H4: referral <URI>
168
169 This directive specifies the referral to pass back when slapd
170 cannot find a local database to handle a request.
171
172 \Example:
173
174 >       referral ldap://root.openldap.org
175
176 This will refer non-local queries to the global root LDAP server
177 at the OpenLDAP Project. Smart LDAP clients can re-ask their
178 query at that server, but note that most of these clients are
179 only going to know how to handle simple LDAP URLs that
180 contain a host part and optionally a distinguished name part.
181
182 H4: schemacheck { on | off }
183
184 This directive turns schema checking on or off. If schema
185 checking is on, entries added or modified through LDAP operations
186 will be checked to ensure they obey the schema rules implied
187 by their object class(es) as defined by the corresponding objectclass
188 directive(s). If schema checking is off this check is not done.
189
190 \Default:
191
192 >       schemacheck on
193
194 H4: sizelimit <integer>
195
196 This directive specifies the maximum number of entries to return
197 from a search operation.
198
199 \Default:
200
201 >       sizelimit 500
202
203
204 H4: srvtab <filename>
205
206 This directive specifies the srvtab file in which slapd can find the
207 Kerberos keys necessary for authenticating clients using
208 Kerberos. This directive is only meaningful if you are using
209 Kerberos authentication, which must be enabled at compile
210 time by including the appropriate definitions in the
211 {{EX:Make-common}} file.
212
213 \Default:
214
215 >       srvtab /etc/srvtab
216
217 H4: timelimit <integer>
218
219 This directive specifies the maximum number of seconds (in real
220 time) slapd will spend answering a search request. If a
221 request is not finished in this time, a result indicating an
222 exceeded timelimit will be returned.
223
224 \Default:
225
226 >       timelimit 3600
227
228
229 H3: General Backend Directives
230
231 H3: General Database Directives
232
233 Directives in this section only apply to the database in which
234 they are defined. They are supported by every type of database.
235
236 H4: database <databasetype>
237
238 This directive marks the beginning of a new database instance
239 definition. <databasetype> should be one of ldbm, shell, or
240 passwd, depending on which backend will serve the
241 database.
242
243 \Example:
244
245 >       database ldbm
246
247 This marks the beginning of a new LDBM backend database
248 instance definition.
249
250 H4: lastmod { on | off }
251
252 This directive controls whether slapd will automatically maintain
253 the modifiersName, modifyTimestamp, creatorsName, and
254 createTimestamp attributes for entries.
255
256 \Default:
257
258 >       lastmod on
259
260 H4: readonly { on | off }
261
262 This directive puts the database into "read-only" mode. Any
263 attempts to modify the database will return an "unwilling to
264 perform" error.
265
266 \Default:
267
268 >       readonly off
269
270 H4: replica
271
272 >       replica host=<hostname>[:<port>]
273 >               "binddn=<DN>"
274 >               [bindmethod={ simple | kerberos }]
275 >               [credentials=<password>]
276 >               [srvtab=<filename>]
277
278 This directive specifies a replication site for this database. The
279 {{EX:host=}} parameter specifies a host and optionally a port where
280 the slave slapd instance can be found. Either a domain name
281 or IP address may be used for <hostname>. If <port> is not
282 given, the standard LDAP port number (389) is used.
283
284 The {{EX:binddn=}} parameter gives the DN to bind as for updates to
285 the slave slapd. It should be a DN which has read/write
286 access to the slave slapd's database, typically given as a
287 {{EX:rootdn}} in the slave's config file. It must also match the
288 updatedn directive in the slave slapd's config file. Since DNs are
289 likely to contain embedded spaces, the entire {{EX:"binddn=<DN>"}}
290 string should be enclosed in double quotes.
291
292 The {{EX:bindmethod}} is either simple or kerberos, depending on
293 whether simple password-based authentication or kerberos
294 authentication is to be used when connecting to the slave
295 slapd. Simple authentication requires a valid password be
296 given. Kerberos authentication requires a valid srvtab file.
297
298 The {{EX:credentials=}} parameter, which is only required if using
299 simple authentication, gives the password for {{EX:binddn}} on the
300 slave slapd.
301
302 The {{EX:srvtab=}} parameter, which is only required if using
303 kerberos, specifies the filename which holds the kerberos key
304 for the slave slapd. If omitted, {{F:/etc/srvtab}} is used.
305
306 See Section 10 for more details on replication.
307
308 H4: replogfile <filename>
309
310 This directive specifies the name of the replication log file to
311 which slapd will log changes. The replication log is typically
312 written by slapd and read by slurpd. Normally, this directive is
313 only used if slurpd is being used to replicate the database.
314 However, you can also use it to generate a transaction log, if
315 slurpd is not running. In this case, you will need to periodically
316 truncate the file, since it will grow indefinitely otherwise.
317
318 See Section 10 for more details on replication.
319
320 H4: rootdn <dn>
321
322 This directive specifies the DN of an entry that is not subject to
323 access control or administrative limit restrictions for
324 operations on this database.
325
326 \Example:
327
328 >       rootdn "cn=Manager, dc=example, dc=com"
329
330 H4: rootkrbname <kerberosname>
331
332 This directive specifies a kerberos name for the DN given above
333 that will always work, regardless of whether an entry with the
334 given DN exists or has a {{EX:krbName}} attribute. This directive is
335 useful when creating a database and also when using slurpd
336 to provide replication service (see Section 10).
337
338 \Example:
339
340 >       rootkrbname admin@EXAMPLE.COM
341
342 H4: rootpw <password>
343
344 This directive specifies a password for the DN given above that
345 will always work, regardless of whether an entry with the given
346 DN exists or has a password. This directive is useful when
347 creating a database and also when using slurpd to provide
348 replication service (see Section 10).
349
350 \Example:
351
352 >       rootpw secret
353
354 H4: suffix <dn suffix>
355
356 This directive specifies the DN suffix of queries that will be
357 passed to this backend database. Multiple suffix lines can be
358 given, and at least one is required for each database
359 definition.
360
361 \Example:
362
363 >       suffix "dc=example, dc=com"
364
365 Queries with a DN ending in "dc=example, dc=com"
366 will be passed to this backend.
367
368 Note: when the backend to pass a query to is selected, slapd
369 looks at the suffix line(s) in each database definition in the
370 order they appear in the file. Thus, if one database suffix is a
371 prefix of another, it must appear after it in the config file.
372
373 H4: updatedn <dn>
374
375 This directive is only applicable in a slave slapd. It specifies the
376 DN allowed to make changes to the replica (typically, this is
377 the DN slurpd binds as when making changes to the replica).
378
379
380
381 H3: LDBM Backend-Specific Directives
382
383 Directives in this category only apply to the LDBM backend
384 database. That is, they must follow a "database ldbm" line and
385 come before any other "database" line.
386
387 H4: cachesize <integer>
388
389 This directive specifies the size in entries of the in-memory
390 cache maintained by the LDBM backend database instance.
391
392 \Default:
393
394 >       cachesize 1000
395
396
397 H4: dbcachesize <integer>
398
399 This directive specifies the size in bytes of the in-memory cache
400 associated with each open index file. If not supported by the
401 underlying database method, this directive is ignored without
402 comment. Increasing this number uses more memory but can
403 cause a dramatic performance increase, especially during
404 modifies or when building indexes.
405
406 \Default:
407
408 >       dbcachesize 100000
409
410
411 H4: directory <directory>
412
413 This directive specifies the directory where the LDBM files
414 containing the database and associated indexes live.
415
416 \Default:
417
418 >       directory /usr/local/var/openldap-ldbm
419
420
421 H4: index {<attrlist> | default} [pres,eq,approx,sub,none]
422
423 This directive specifies the indexes to maintain for the given
424 attribute. If only an <attrlist> is given, all possible indexes are
425 maintained.
426
427 \Example:
428
429 >       index default pres,eq
430 >       index objectClass,uid
431 >       index cn,sn eq,sub,approx
432
433 The first line sets the default to indices to maintain to present
434 and equality.  The second line causes the default (pres,eq) set
435 of indices to be maintained for objectClass and uid attribute
436 types.  The third line causes equality, substring, and approximate
437 filters to be maintained for cn and sn attribute types.
438
439 H4: mode <integer>
440
441 This directive specifies the file protection mode that newly
442 created database index files should have.
443
444 \Default:
445
446 >       mode 0600
447
448
449
450 H3: Shell Backend-Specific Directives
451
452 >       bind <pathname>
453 >       unbind <pathname>
454 >       search <pathname>
455 >       compare <pathname>
456 >       modify <pathname>
457 >       modrdn <pathname>
458 >       add <pathname>
459 >       delete <pathname>
460 >       abandon <pathname>
461
462 These directives specify the pathname of the command to
463 execute in response to the given LDAP operation. The
464 command given should understand and follow the input/output
465 conventions described in Appendix B.
466
467 \Example:
468
469 >       search /usr/local/bin/search.sh
470
471 Note that you need only supply those commands you want the
472 backend to handle. Operations for which a command is not
473 supplied will be refused with an "unwilling to perform" error.
474
475
476
477 H3: Password Backend-Specific Directives
478
479 Directives in this category only apply to the PASSWD backend
480 database. That is, they must follow a "database passwd" line
481 and come before any other "database" line.
482
483 H4: file <filename>
484
485 This directive specifies an alternate passwd file to use.
486
487 \Default:
488
489 >       file /etc/passwd
490
491
492
493 H3: TCL Backend-Specific Directives
494
495 H4: scriptpath <pathname>
496
497 This is the full path to a file containing the TCL command(s) to handle
498 the LDAP operations.
499
500 H4: Proc specifiers
501
502 >       bind <proc>
503 >       unbind <proc>
504 >       search <proc>
505 >       compare <proc>
506 >       modify <proc>
507 >       modrdn <proc>
508 >       add <proc>
509 >       delete <proc>
510 >       abandon <proc>
511
512 These directives specify the name of the proc (function) in the
513 TCL script specified in {{EX:scriptpath}} to execute in response to
514 the given LDAP operation.
515
516 \Example:
517
518 >       search proc_search
519
520 Note that you need only supply those commands you want the
521 TCL backend to handle. Operations for which a command is not
522 supplied will be refused with an "unwilling to perform" error.
523
524 H4: tclrealm <name>
525
526 This is one of the biggest pluses of using the TCL backend.
527 The realm let's you group several databases to the same interpretor.
528 This basically means they share the same global variables and proc
529 space. So global variables, as well as all the procs are callable
530 between databases. If no {{EX:tclrealm}} is specified, it is put into the
531 "default" realm.
532
533
534
535 H2: Access Control
536
537 Access to slapd entries and attributes is controlled by the
538 access configuration file directive. The general form of an
539 access line is:
540
541 >       <access directive> ::= access to <what>
542 >               [by <who> <access> <control>]+
543 >       <what> ::= * | [ dn[.<target style>]=<regex>]
544 >               [filter=<ldapfilter>] [attrs=<attrlist>]
545 >       <target style> ::= regex | base | one | subtree | children
546 >       <attrlist> ::= <attr> | <attr> , <attrlist>
547 >       <attr> ::= <attrname> | entry | children
548 >       <who> ::= [* | anonymous | users | self |
549 >               dn[.<subject style>]=<regex>]
550 >               [dnattr=<attrname> ]
551 >               [group[/<objectclass>[/<attrname>][.<basic style>]]=<regex> ]
552 >               [peername[.<basic style>]=<regex>]
553 >               [sockname[.<basic style>]=<regex>]
554 >               [domain[.<basic style>]=<regex>]
555 >               [sockurl[.<basic style>]=<regex>]
556 >               [set=<setspec>]
557 >               [aci=<attrname>]
558 >       <subject style> ::= regex | exact | base | one | subtree | children
559 >       <basic style> ::= regex | exact
560 >       <access> ::= [self]{<level>|<priv>}
561 >       <level> ::= none | auth | compare | search | read | write
562 >       <priv> ::= {=|+|-}{w|r|s|c|x}+
563 >       <control> ::= [stop | continue | break]
564
565 where the <what> part selects the entries and/or attributes to
566 which the access applies, the {{EX:<who>}} part specifies which
567 entities are granted access, and the {{EX:<access>}} part specifies
568 the access granted. Multiple {{EX:<who> <access> <control>}} triplets
569 are supported, allowing many entities to be granted different
570 access to the same set of entries and attributes.
571
572
573 H3: What to control access to
574
575 The <what> part of an access specification determines the
576 entries and attributes to which the access control applies.
577 Entries can be selected in two ways: by a regular expression
578 matching the entry's distinguished name:
579
580 >       dn=<regular expression>
581
582 Note: The DN pattern specified should be "normalized",
583 meaning that there should be no extra spaces, and commas
584 should be used to separate components. An example
585 normalized DN is "cn=Babs Jensen,dc=example,dc=com".
586 An example of a non-normalized DN is
587 "cn=Babs Jensen; dc=example, dc=com".
588
589 Or, entries may be selected by a filter matching some
590 attribute(s) in the entry:
591
592 >       filter=<ldap filter>
593
594 where <ldap filter> is a string representation of an LDAP
595 search filter, as described in RFC 2254.
596
597 The special entry selector "*" is used to select any entry,
598 and is a convenient shorthand for the equivalent "dn=.*" selector.
599
600 Attributes within an entry are selected by including a
601 comma-separated list of attribute names in the <what>
602 selector:
603
604 >       attrs=<attribute list>
605
606 Access to the entry itself must be granted or denied using the
607 special attribute name "{{EX:entry}}". Note that giving access to an
608 attribute is not enough; access to the entry itself through the
609 {{EX:entry}} attribute is also required. The complete examples at
610 the end of this section should help clear things up.
611
612
613
614 H2: Who to grant access to
615
616 The <who> part identifies the entity or entities being granted
617 access. Note that access is granted to "entities" not "entries."
618 Entities can be specified by the special "*" identifier, matching
619 any entry, the keyword "self" matching the entry protected by
620 the access, or by a regular expression matching an entry's
621 distinguished name:
622
623 >       dn=<regular expression>
624
625 Note:  The DN pattern specified should be "normalized",
626 meaning that there should be no extra spaces, and commas
627 should be used to separate components.
628
629 Or entities can be specified by a regular expression matching
630 the client's IP address or domain name:
631
632 >       addr=<regular expression>
633 >       domain=<regular expression>
634
635 or by an entry listed in a DN-valued attribute in the entry to
636 which the access applies:
637
638 >       dnattr=<dn-valued attribute name>
639
640 The dnattr specification is used to give access to an entry
641 whose DN is listed in an attribute of the entry (e.g., give
642 access to a group entry to whoever is listed as the owner of
643 the group entry).
644
645
646
647 H3: The access to grant
648
649
650 The kind of <access> granted can be one of the following:
651
652
653 !block table; colaligns="LRL"; align=Center; \
654         title="Table 5.2: Access Levels"
655 Level   Privledges      Description
656 none                    no access
657 auth    =x              needed to bind
658 compare =cx             needed to compare
659 search  =scx            needed to apply search filters
660 read    =rscx           needed to read search results
661 write   =wrscx          needed to modify/rename
662 !endblock
663
664 Each level implies all lower levels of access. So, for
665 example, granting someone write access to an entry also
666 grants them read, search, compare, and auth access.  However,
667 one may use the privledges specify to grant specific permissions.
668
669
670 H3: Access Control Evaluation
671
672 When evaluating whether some requester should be given
673 access to an entry and/or attribute, slapd compares the entry
674 and/or attribute to the {{EX:<what>}} selectors given in the
675 configuration file. Access directives local to the current
676 database are examined first, followed by global access
677 directives. Within this priority, access directives are
678 examined in the order in which they appear in the config file.
679 Slapd stops with the first {{EX:<what>}} selector that matches the
680 entry and/or attribute. The corresponding access directive is
681 the one slapd will use to evaluate access.
682
683 Next, slapd compares the entity requesting access to the
684 {{EX:<who>}} selectors within the access directive selected above,
685 in the order in which they appear. It stops with the first {{EX:<who>}}
686 selector that matches the requester. This determines the
687 access the entity requesting access has to the entry and/or
688 attribute.
689
690 Finally, slapd compares the access granted in the selected
691 {{EX:<access>}} clause to the access requested by the client. If it
692 allows greater or equal access, access is granted. Otherwise,
693 access is denied.
694
695 The order of evaluation of access directives makes their
696 placement in the configuration file important. If one access
697 directive is more specific than another in terms of the entries
698 it selects, it should appear first in the config file. Similarly, if
699 one {{EX:<who>}} selector is more specific than another it should
700 come first in the access directive. The access control
701 examples given below should help make this clear.
702
703
704
705 H3: Access Control Examples
706
707
708
709 The access control facility described above is quite powerful.
710 This section shows some examples of its use. First, some
711 simple examples:
712
713 >       access to * by * read
714
715 This access directive grants read access to everyone.
716
717 >       access to *
718 >               by self write
719 >               by anonymous auth
720 >               by * read
721
722 This directive allows users to modify their own entries,
723 allows authenticate, and allows authenticated users to read.
724 Note that only the first {{EX:by <who>}} clause which matches applies.
725 Hence, the anonymous users are granted {{EX:auth}}, not {{EX:read}}.
726
727 The following example shows the use of a regular expression
728 to select the entries by DN in two access directives where
729 ordering is significant.
730
731 >       access to dn=".*,dc=example,dc=com"
732 >               by * search
733 >       access to dn=".*,dc=com"
734 >               by * read
735
736 Read access is granted to entries under the {{EX:dc=com}}.
737 subtree, except for those entries under the {{EX:dc=example,dc=com}}
738 subtree, to which search access is granted.  No access to
739 {{EX:dc=com}} as the neither access directive matches this DN.
740 If the order of these access directives was reversed, the
741 trailing directive would never be reached, since all
742 {{EX:dc=example,dc=com}} entries are also {{EX:dc=com}} entries.
743
744 Also note that if no {{EX:access to}} directive matches or
745 no {{EX:by <who>}} clause, {{B:access is denied}}.  That is, every
746 {{EX:access to}} directive ends with a implicit {{EX:by * none}}
747 clause and access list itself ends with {{EX:access to * by * none}}
748 directive.  Only if no access controls are specified, is the
749 {{EX:defaultaccess}} granted.
750
751 The next example again shows the importance of ordering,
752 both of the access directives and the {{EX:by <who>}} clauses.
753 It also shows the use of an attribute selector to grant access
754 to a specific attribute and various {{EX:<who>}} selectors.
755
756 >       access to dn="(.*,)?dc=example,dc=com" attr=homePhone
757 >               by self write
758 >               by dn="(.*,)?dc=example,dc=com" search
759 >               by domain=.*\.example\.com read
760 >       access to dn="(.*,)?dc=example,dc=com"
761 >               by self write
762 >               by dn=".*,dc=example,dc=com" search
763 >               by anonymous auth
764
765 This example applies to entries in the "{{EX:dc=example, dc=com}}"
766 subtree. To all attributes except {{EX:homePhone}}, the entry itself
767 can write them, other {{EX:example.com}} entries can search by them,
768 anybody else has no access ((implicit {{EX:by * none}}) excepting for
769 authentication/authorization (which is always done anonymously).
770 The {{EX:homePhone}} attribute is writable by the entry, searchable
771 by other {{EX:example.com}} entries, readable by clients connecting
772 from somewhere in the {{EX:example.com}} domain, and otherwise not
773 readable (implicit {{EX:by * none}}).  All other access
774 is denied by the implicit {{EX:access to * by * none}}.
775
776 Sometimes it is useful to permit a particular DN to add or
777 remove itself from an attribute. For example, if you would like to
778 create a group and allow people too add and remove only
779 their own DN from the member attribute, you could accomplish
780 it with an access directive like this:
781
782 >       access to attr=member,entry
783 >               by dnattr=member selfwrite
784
785 The dnattr {{EX:<who>}} selector says that the access applies to
786 entries listed in the {{EX:member}} attribute. The {{EX:selfwrite}} access
787 selector says that such members can only add or delete their
788 own DN from the attribute, not other values. The addition of
789 the entry attribute is required because access to the entry is
790 required to access any of the entry's attributes.
791
792 Note that the {{EX:attr=member}} construct in the {{EX:<what>}}
793 clause is a shorthand for the clause "{{EX:dn=.* attr=member}}"
794 (i.e., it matches the {{EX:member}} attribute in all entries).
795
796
797
798 H2: Schema Specification
799
800 The {{EX:objectclass}} and {{attributeTypes}} configuration file
801 directives can be used to define schema rules on entries in the
802 directory.
803
804 H3: Object Identifiers
805
806 Each schema element is identified by a globally unique Object
807 Identifier (OID).  OIDs are also used to identify other objects.
808 They are commonly found in protocols described by ASN.1.  In
809 particular, they are heavy used by Simple Network Management
810 Protocol (SNMP).  As OIDs are hierarchical, your organization
811 can obtain one OID and branch in as needed.  For example,
812 if your organization were assigned OID 1.1, you could branch
813 the tree as follows:
814
815 !block table; colaligns="RL"; align=Center; \
816         title="Table 5.1: Debugging Levels"
817 OID             Assignment
818 1.1             Organization's OID
819 1.1.1           SNMP Elements
820 1.1.2           LDAP Elements
821 1.1.2.1         AttributeTypes
822 1.1.2.1.1       myAttribute
823 1.1.2.2         ObjectClasses
824 1.1.2.2.1       myObjectClass
825 !endblock
826
827 You are, of course, free to design a hierarchy suitable to your
828 organizational needs under your organization's OID.
829
830 .{{Under no circumstances should you use a fictious OID!}} 
831
832 To obtain a fully registered OID at {{no cost}}, apply for
833 a OID under {{ORG[expand]IANA}} maintained
834 {{Private Enterprise}} arch.  Any private enterprise (organization)
835 may request an OID to be assigned under this arch.  Just fill
836 out the form at {{URL: http://www.iana.org/cgi-bin/enterprise.pl}}
837 and your official OID will be sent to you usually within a few days.
838
839 H3: AttributeType Specification
840
841 {{B:To be specified.}}
842
843 H3: ObjectClass Specification
844
845 The schema rules are defined by one or more
846 objectclass lines, and enforcement is turned on or off via the
847 schemacheck directives. The format of an {{EX:objectclass}} line is:
848
849 >       objectclass <RFC2252 Object Class Description>
850
851 This directive defines the schema rules for the object class
852 given by {{EX:<name>}}. Schema rules consist of the attributes the
853 entry is required to have (given by the requires {{EX:<attrs>}}
854 clause) and those attributes that it may optionally have (given
855 by the allows {{EX:<attrs>}} clause). In both clauses, {{EX:<attrs>}}
856 is a comma-separated list of attribute names.
857
858 For example, to define an object class called {{myPerson}}, you
859 might include a definition like this:
860
861 >       objectclass ( 1.2.3 NAME 'myPerson'
862 >               DESC 'my person'
863 >               MUST ( cn $ sn )
864 >               MAY ( mail $ phone $ fax ) )
865
866
867
868 H2: Configuration File Example
869
870 The following is an example configuration file, interspersed
871 with explanatory text. It defines two databases to handle
872 different parts of the {{TERM:X.500}} tree; both are {{TERM:LDBM}}
873 database instances. The line numbers shown are provided for
874 reference only and are not included in the actual file. First, the
875 global configuration section:
876
877 E: 1. # example config file - global configuration section
878 E: 2. include /usr/local/etc/schema/core.schema
879 E: 3. referral ldap://root.openldap.org
880
881 Line 1 is a comment. Lines 2 include another config file
882 which containing {{core}} schema definitions.
883 The {{EX:referral}} directive on line 3
884 means that queries not local to one of the databases defined
885 below will be referred to the LDAP server running on the
886 standard port (389) at the host {{EX:root.openldap.org}}.
887
888 The next section of the configuration file defines an LDBM
889 backend that will handle queries for things in the
890 "dc=example,dc=com" portion of the tree. The
891 database is to be replicated to two slave slapds, one on
892 truelies, the other on judgmentday. Indexes are to be
893 maintained for several attributes, and the {{EX:userPassword}}
894 attribute is to be protected from unauthorized access.
895
896 E:  4. # ldbm definition for the example.com
897 E:  5. database ldbm
898 E:  6. suffix "dc=example, dc=com"
899 E:  7. directory /usr/local/var/openldap
900 E:  8. rootdn "cn=Manager, dc=example, dc=com"
901 E:  9. rootpw secret
902 E: 10. replogfile /usr/local/var/openldap/slapd.replog
903 E: 11. replica host=slave1.example.com:389
904 E: 12.   binddn="cn=Replicator, dc=example, dc=com"
905 E: 13.   bindmethod=simple credentials=secret
906 E: 14. replica host=slave2.example.com
907 E: 15.   binddn="cn=Replicator, dc=example, dc=com"
908 E: 16.   bindmethod=kerberos
909 E: 17.   srvtab=/etc/srvtab.slave2
910 E: 18. # ldbm indexed attribute definitions
911 E: 19. index uid pres,eq
912 E: 20. index cn,sn,uid pres,eq,approx,sub
913 E: 21. index objectClass eq
914 E: 22. # ldbm access control definitions
915 E: 23. access to attr=userPassword
916 E: 24.   by self write
917 E: 25.   by anonymous auth
918 E: 26.   by dn="cn=Admin,dc=example,dc=com" write
919 E: 27.   by * none
920 E: 28. access to *
921 E: 29.   by self write
922 E: 30.   by anonymous auth
923 E: 31.   by dn="cn=Admin,dc=example,dc=com" write
924 E: 32.   by * read
925
926 Line 4 is a comment. The start of the database definition is
927 marked by the database keyword on line 5. Line 6 specifies
928 the DN suffix for queries to pass to this database. Line 7
929 specifies the directory in which the database files will live
930
931 Lines 8 and 9 identify the database "super user" entry and
932 associated password. This entry is not subject to access
933 control or size or time limit restrictions.
934
935 Lines 10 through 17 are for replication. Line 10 specifies the
936 replication log file (where changes to the database are logged
937 \- this file is written by slapd and read by slurpd). Lines 11 
938 through 13 specify the hostname and port for a replicated
939 host, the DN to bind as when performing updates, the bind
940 method (simple) and the credentials (password) for the
941 binddn. Lines 14 through 17 specify a second replication site,
942 using kerberos instead of simple authentication. See Section
943 10 on slurpd for more information on these directives.
944
945 Lines 19 through 21 indicate the indexes to maintain for
946 various attributes.
947
948 Lines 23 through 32 specify access control for entries in the
949 database. For all entries, the {{EX:userPassword}} attribute is
950 writable by the entry and the "admin" entry, may be used for
951 authentication/authorization purposes, but is otherwise not
952 readable.  All other attributes by writable by the entry and
953 the "admin" entry, may be used for authentication/authorization
954 purposes, but may be read by authenticated users.
955
956 The next section of the example configuration file defines
957 another LDBM database. This one handles queries involving
958 the {{EX:dc=example,dc=net}} subtree.
959
960 E: 33. # ldbm definition for example.net
961 E: 34. database ldbm
962 E: 35. suffix "dc=example, dc=net"
963 E: 36. directory /usr/local/var/ldbm-example-net
964 E: 37. rootdn "cn=Manager, dc=example, dc=net"
965