1 /* slap.h - stand alone ldap server include file */
4 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include "ldap_defaults.h"
14 #include <ac/stdlib.h>
16 #include <sys/types.h>
17 #include <ac/syslog.h>
19 #include <ac/signal.h>
20 #include <ac/socket.h>
27 #define ldap_debug slap_debug
33 #include <ldap_schema.h>
35 #include "ldap_pvt_thread.h"
36 #include "ldap_queue.h"
38 #define SLAP_EXTENDED_SCHEMA 1
42 * SLAPD Memory allocation macros
44 * Unlike ch_*() routines, these routines do not assert() upon
45 * allocation error. They are intended to be used instead of
46 * ch_*() routines where the caller has implemented proper
47 * checking for and handling of allocation errors.
49 * Patches to convert ch_*() calls to SLAP_*() calls welcomed.
51 #define SLAP_MALLOC(s) ber_memalloc((s))
52 #define SLAP_CALLOC(n,s) ber_memcalloc((n),(s))
53 #define SLAP_REALLOC(p,s) ber_memrealloc((p),(s))
54 #define SLAP_FREE(p) ber_memfree((p))
55 #define SLAP_VFREE(v) ber_memvfree((void**)(v))
56 #define SLAP_STRDUP(s) ber_strdup((s))
57 #define SLAP_STRNDUP(s,l) ber_strndup((s),(l))
60 #undef f_next /* name conflict between sys/file.h on SCO and struct filter */
63 #define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
64 #define SLAPD_ANONYMOUS "cn=anonymous"
66 /* LDAPMod.mod_op value ===> Must be kept in sync with ldap.h!
68 * This is a value used internally by the backends. It is needed to allow
69 * adding values that already exist without getting an error as required by
70 * modrdn when the new rdn was already an attribute value itself.
71 * JCG 05/1999 (gomez@engr.sgi.com)
73 #define SLAP_MOD_SOFTADD 0x1000
75 #define MAXREMATCHES (100)
77 #define SLAP_MAX_WORKER_THREADS (32)
79 #define SLAP_SB_MAX_INCOMING_DEFAULT ((1<<18) - 1)
80 #define SLAP_SB_MAX_INCOMING_AUTH ((1<<24) - 1)
82 #define SLAP_TEXT_BUFLEN (256)
84 /* psuedo error code indicating abandoned operation */
85 #define SLAPD_ABANDON (-1)
87 /* psuedo error code indicating disconnect */
88 #define SLAPD_DISCONNECT (-2)
91 /* We assume "C" locale, that is US-ASCII */
92 #define ASCII_SPACE(c) ( (c) == ' ' )
93 #define ASCII_LOWER(c) ( (c) >= 'a' && (c) <= 'z' )
94 #define ASCII_UPPER(c) ( (c) >= 'A' && (c) <= 'Z' )
95 #define ASCII_ALPHA(c) ( ASCII_LOWER(c) || ASCII_UPPER(c) )
96 #define ASCII_DIGIT(c) ( (c) >= '0' && (c) <= '9' )
97 #define ASCII_ALNUM(c) ( ASCII_ALPHA(c) || ASCII_DIGIT(c) )
98 #define ASCII_PRINTABLE(c) ( (c) >= ' ' && (c) <= '~' )
100 #define SLAP_NIBBLE(c) ((c)&0x0f)
101 #define SLAP_ESCAPE_CHAR ('\\')
102 #define SLAP_ESCAPE_LO(c) ( "0123456789ABCDEF"[SLAP_NIBBLE(c)] )
103 #define SLAP_ESCAPE_HI(c) ( SLAP_ESCAPE_LO((c)>>4) )
105 #define FILTER_ESCAPE(c) ( (c) == '*' || (c) == '\\' \
106 || (c) == '(' || (c) == ')' || !ASCII_PRINTABLE(c) )
108 #define DN_ESCAPE(c) ((c) == SLAP_ESCAPE_CHAR)
109 #define DN_SEPARATOR(c) ((c) == ',' || (c) == ';')
110 #define RDN_ATTRTYPEANDVALUE_SEPARATOR(c) ((c) == '+') /* RFC 2253 */
111 #define RDN_SEPARATOR(c) (DN_SEPARATOR(c) || RDN_ATTRTYPEANDVALUE_SEPARATOR(c))
112 #define RDN_NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
114 #define DESC_LEADCHAR(c) ( ASCII_ALPHA(c) )
115 #define DESC_CHAR(c) ( ASCII_ALNUM(c) || (c) == '-' )
116 #define OID_LEADCHAR(c) ( ASCII_DIGIT(c) )
117 #define OID_SEPARATOR(c) ( (c) == '.' )
118 #define OID_CHAR(c) ( OID_LEADCHAR(c) || OID_SEPARATOR(c) )
120 #define ATTR_LEADCHAR(c) ( DESC_LEADCHAR(c) || OID_LEADCHAR(c) )
121 #define ATTR_CHAR(c) ( DESC_CHAR((c)) || (c) == '.' )
123 #define AD_LEADCHAR(c) ( ATTR_CHAR(c) )
124 #define AD_CHAR(c) ( ATTR_CHAR(c) || (c) == ';' )
126 #define SLAP_NUMERIC(c) ( ASCII_DIGIT(c) || ASCII_SPACE(c) )
128 #define SLAP_PRINTABLE(c) ( ASCII_ALNUM(c) || (c) == '\'' || \
129 (c) == '(' || (c) == ')' || (c) == '+' || (c) == ',' || \
130 (c) == '-' || (c) == '.' || (c) == '/' || (c) == ':' || \
131 (c) == '?' || (c) == ' ' || (c) == '=' )
132 #define SLAP_PRINTABLES(c) ( SLAP_PRINTABLE(c) || (c) == '$' )
134 /* must match in schema_init.c */
135 #define SLAPD_DN_SYNTAX "1.3.6.1.4.1.1466.115.121.1.12"
136 #define SLAPD_NAMEUID_SYNTAX "1.3.6.1.4.1.1466.115.121.1.34"
137 #define SLAPD_GROUP_ATTR "member"
138 #define SLAPD_GROUP_CLASS "groupOfNames"
139 #define SLAPD_ROLE_ATTR "roleOccupant"
140 #define SLAPD_ROLE_CLASS "organizationalRole"
142 #ifdef SLAPD_ACI_ENABLED
143 #define SLAPD_ACI_SYNTAX "1.3.6.1.4.1.4203.666.2.1"
146 #define SLAPD_OCTETSTRING_SYNTAX "1.3.6.1.4.1.1466.115.121.1.40"
148 /* change this to "OpenLDAPset" */
149 #define SLAPD_ACI_SET_ATTR "template"
151 #define SLAPD_TOP_OID "2.5.6.0"
153 LDAP_SLAPD_V (int) slap_debug;
155 typedef unsigned long slap_mask_t;
157 /* Security Strength Factor */
158 typedef unsigned slap_ssf_t;
160 typedef struct slap_ssf_set {
162 slap_ssf_t sss_transport;
165 slap_ssf_t sss_update_ssf;
166 slap_ssf_t sss_update_transport;
167 slap_ssf_t sss_update_tls;
168 slap_ssf_t sss_update_sasl;
169 slap_ssf_t sss_simple_bind;
173 /* Flags for telling slap_sasl_getdn() what type of identity is being passed */
174 #define SLAP_GETDN_AUTHCID 2
175 #define SLAP_GETDN_AUTHZID 4
180 #define SLAP_INDEX_TYPE 0x00FFUL
181 #define SLAP_INDEX_UNDEFINED 0x0001UL
182 #define SLAP_INDEX_PRESENT 0x0002UL
183 #define SLAP_INDEX_EQUALITY 0x0004UL
184 #define SLAP_INDEX_APPROX 0x0008UL
185 #define SLAP_INDEX_SUBSTR 0x0010UL
186 #define SLAP_INDEX_EXTENDED 0x0020UL
188 #define SLAP_INDEX_DEFAULT SLAP_INDEX_EQUALITY
190 #define IS_SLAP_INDEX(mask, type) (((mask) & (type)) == (type))
192 #define SLAP_INDEX_SUBSTR_TYPE 0x0F00UL
194 #define SLAP_INDEX_SUBSTR_INITIAL ( SLAP_INDEX_SUBSTR | 0x0100UL )
195 #define SLAP_INDEX_SUBSTR_ANY ( SLAP_INDEX_SUBSTR | 0x0200UL )
196 #define SLAP_INDEX_SUBSTR_FINAL ( SLAP_INDEX_SUBSTR | 0x0400UL )
197 #define SLAP_INDEX_SUBSTR_DEFAULT \
198 ( SLAP_INDEX_SUBSTR \
199 | SLAP_INDEX_SUBSTR_INITIAL \
200 | SLAP_INDEX_SUBSTR_ANY \
201 | SLAP_INDEX_SUBSTR_FINAL )
203 #define SLAP_INDEX_SUBSTR_MINLEN 2
204 #define SLAP_INDEX_SUBSTR_MAXLEN 4
205 #define SLAP_INDEX_SUBSTR_STEP 2
207 #define SLAP_INDEX_FLAGS 0xF000UL
208 #define SLAP_INDEX_NOSUBTYPES 0x1000UL /* don't use index w/ subtypes */
209 #define SLAP_INDEX_NOLANG 0x2000UL /* don't use index w/ lang */
212 * there is a single index for each attribute. these prefixes ensure
213 * that there is no collision among keys.
215 #define SLAP_INDEX_EQUALITY_PREFIX '=' /* prefix for equality keys */
216 #define SLAP_INDEX_APPROX_PREFIX '~' /* prefix for approx keys */
217 #define SLAP_INDEX_SUBSTR_PREFIX '*' /* prefix for substring keys */
218 #define SLAP_INDEX_SUBSTR_INITIAL_PREFIX '^'
219 #define SLAP_INDEX_SUBSTR_FINAL_PREFIX '$'
220 #define SLAP_INDEX_CONT_PREFIX '.' /* prefix for continuation keys */
222 #define SLAP_SYNTAX_MATCHINGRULES_OID "1.3.6.1.4.1.1466.115.121.1.30"
223 #define SLAP_SYNTAX_ATTRIBUTETYPES_OID "1.3.6.1.4.1.1466.115.121.1.3"
224 #define SLAP_SYNTAX_OBJECTCLASSES_OID "1.3.6.1.4.1.1466.115.121.1.37"
225 #define SLAP_SYNTAX_MATCHINGRULEUSES_OID "1.3.6.1.4.1.1466.115.121.1.31"
226 #define SLAP_SYNTAX_CONTENTRULE_OID "1.3.6.1.4.1.1466.115.121.1.16"
228 #ifdef LDAP_CLIENT_UPDATE
229 #define LCUP_COOKIE_OID "1.3.6.1.4.1.4203.666.10.1"
230 #endif /* LDAP_CLIENT_UPDATE */
233 * represents schema information for a database
235 #define SLAP_SCHERR_OUTOFMEM 1
236 #define SLAP_SCHERR_CLASS_NOT_FOUND 2
237 #define SLAP_SCHERR_CLASS_BAD_USAGE 3
238 #define SLAP_SCHERR_CLASS_BAD_SUP 4
239 #define SLAP_SCHERR_CLASS_DUP 5
240 #define SLAP_SCHERR_ATTR_NOT_FOUND 6
241 #define SLAP_SCHERR_ATTR_BAD_MR 7
242 #define SLAP_SCHERR_ATTR_BAD_USAGE 8
243 #define SLAP_SCHERR_ATTR_BAD_SUP 9
244 #define SLAP_SCHERR_ATTR_INCOMPLETE 10
245 #define SLAP_SCHERR_ATTR_DUP 11
246 #define SLAP_SCHERR_MR_NOT_FOUND 12
247 #define SLAP_SCHERR_MR_INCOMPLETE 13
248 #define SLAP_SCHERR_MR_DUP 14
249 #define SLAP_SCHERR_SYN_NOT_FOUND 15
250 #define SLAP_SCHERR_SYN_DUP 16
251 #define SLAP_SCHERR_NO_NAME 17
252 #define SLAP_SCHERR_NOT_SUPPORTED 18
253 #define SLAP_SCHERR_BAD_DESCR 19
254 #define SLAP_SCHERR_OIDM 20
255 #define SLAP_SCHERR_CR_DUP 21
256 #define SLAP_SCHERR_CR_BAD_STRUCT 22
257 #define SLAP_SCHERR_CR_BAD_AUX 23
258 #define SLAP_SCHERR_CR_BAD_AT 24
259 #define SLAP_SCHERR_LAST SLAP_SCHERR_CR_BAD_AT
261 typedef union slap_sockaddr {
262 struct sockaddr sa_addr;
263 struct sockaddr_in sa_in_addr;
265 struct sockaddr_storage sa_storage;
266 struct sockaddr_in6 sa_in6_addr;
269 struct sockaddr_un sa_un_addr;
274 extern int slap_inet4or6;
277 typedef struct slap_oid_macro {
278 struct berval som_oid;
280 struct slap_oid_macro *som_next;
283 /* forward declarations */
285 struct slap_matching_rule;
287 typedef int slap_syntax_validate_func LDAP_P((
288 struct slap_syntax *syntax,
289 struct berval * in));
291 typedef int slap_syntax_transform_func LDAP_P((
292 struct slap_syntax *syntax,
294 struct berval * out));
296 typedef struct slap_syntax {
298 #define ssyn_oid ssyn_syn.syn_oid
299 #define ssyn_desc ssyn_syn.syn_desc
300 #define ssyn_extensions ssyn_syn.syn_extensions
303 ber_len_t ssyn_oidlen;
304 * has been replaced by a struct berval that uses the value
305 * provided by ssyn_syn.syn_oid; a macro that expands to
306 * the bv_len field of the berval is provided for backward
307 * compatibility. CAUTION: NEVER FREE THE BERVAL
309 struct berval ssyn_bvoid;
310 #define ssyn_oidlen ssyn_bvoid.bv_len
312 unsigned int ssyn_flags;
314 #define SLAP_SYNTAX_NONE 0x0000U
315 #define SLAP_SYNTAX_BLOB 0x0001U /* syntax treated as blob (audio) */
316 #define SLAP_SYNTAX_BINARY 0x0002U /* binary transfer required (certificate) */
317 #define SLAP_SYNTAX_BER 0x0004U /* stored in BER encoding (certificate) */
318 #define SLAP_SYNTAX_HIDE 0x8000U /* hide (do not publish) */
320 slap_syntax_validate_func *ssyn_validate;
321 slap_syntax_transform_func *ssyn_normalize;
322 slap_syntax_transform_func *ssyn_pretty;
324 #ifdef SLAPD_BINARY_CONVERSION
325 /* convert to and from binary */
326 slap_syntax_transform_func *ssyn_ber2str;
327 slap_syntax_transform_func *ssyn_str2ber;
330 struct slap_syntax *ssyn_next;
333 #define slap_syntax_is_flag(s,flag) ((int)((s)->ssyn_flags & (flag)) ? 1 : 0)
334 #define slap_syntax_is_blob(s) slap_syntax_is_flag((s),SLAP_SYNTAX_BLOB)
335 #define slap_syntax_is_binary(s) slap_syntax_is_flag((s),SLAP_SYNTAX_BINARY)
336 #define slap_syntax_is_ber(s) slap_syntax_is_flag((s),SLAP_SYNTAX_BER)
337 #define slap_syntax_is_hidden(s) slap_syntax_is_flag((s),SLAP_SYNTAX_HIDE)
339 typedef struct slap_syntax_defs_rec {
342 slap_syntax_validate_func *sd_validate;
343 slap_syntax_transform_func *sd_normalize;
344 slap_syntax_transform_func *sd_pretty;
345 #ifdef SLAPD_BINARY_CONVERSION
346 slap_syntax_transform_func *sd_ber2str;
347 slap_syntax_transform_func *sd_str2ber;
349 } slap_syntax_defs_rec;
351 /* X -> Y Converter */
352 typedef int slap_mr_convert_func LDAP_P((
354 struct berval * out ));
357 typedef int slap_mr_normalize_func LDAP_P((
359 struct slap_syntax *syntax, /* NULL if in is asserted value */
360 struct slap_matching_rule *mr,
362 struct berval * out ));
364 /* Match (compare) function */
365 typedef int slap_mr_match_func LDAP_P((
368 struct slap_syntax *syntax, /* syntax of stored value */
369 struct slap_matching_rule *mr,
370 struct berval * value,
371 void * assertValue ));
373 /* Index generation function */
374 typedef int slap_mr_indexer_func LDAP_P((
377 struct slap_syntax *syntax, /* syntax of stored value */
378 struct slap_matching_rule *mr,
379 struct berval *prefix,
383 /* Filter index function */
384 typedef int slap_mr_filter_func LDAP_P((
387 struct slap_syntax *syntax, /* syntax of stored value */
388 struct slap_matching_rule *mr,
389 struct berval *prefix,
393 typedef struct slap_matching_rule_use MatchingRuleUse;
395 typedef struct slap_matching_rule {
396 LDAPMatchingRule smr_mrule;
397 MatchingRuleUse *smr_mru;
398 /* RFC2252 string representation */
399 struct berval smr_str;
402 ber_len_t smr_oidlen;
403 * has been replaced by a struct berval that uses the value
404 * provided by smr_mrule.mr_oid; a macro that expands to
405 * the bv_len field of the berval is provided for backward
406 * compatibility. CAUTION: NEVER FREE THE BERVAL
408 struct berval smr_bvoid;
409 #define smr_oidlen smr_bvoid.bv_len
411 slap_mask_t smr_usage;
413 #define SLAP_MR_HIDE 0x8000U
415 #define SLAP_MR_TYPE_MASK 0x0F00U
416 #define SLAP_MR_SUBTYPE_MASK 0x00F0U
417 #define SLAP_MR_USAGE 0x000FU
419 #define SLAP_MR_NONE 0x0000U
420 #define SLAP_MR_EQUALITY 0x0100U
421 #define SLAP_MR_ORDERING 0x0200U
422 #define SLAP_MR_SUBSTR 0x0400U
423 #define SLAP_MR_EXT 0x0800U /* implicitly extensible */
425 #define SLAP_MR_EQUALITY_APPROX ( SLAP_MR_EQUALITY | 0x0010U )
426 #define SLAP_MR_DN_FOLD 0x0008U
428 #define SLAP_MR_SUBSTR_INITIAL ( SLAP_MR_SUBSTR | 0x0010U )
429 #define SLAP_MR_SUBSTR_ANY ( SLAP_MR_SUBSTR | 0x0020U )
430 #define SLAP_MR_SUBSTR_FINAL ( SLAP_MR_SUBSTR | 0x0040U )
433 * normally the provided value is expected to conform to
434 * assertion syntax specified in the matching rule, however
435 * at times (such as during individual value modification),
436 * the provided value is expected to conform to the
437 * attribute's value syntax.
439 #define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U
440 #define SLAP_MR_VALUE_SYNTAX_MATCH 0x0001U
441 #define SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH 0x0003U
443 #define SLAP_IS_MR_ASSERTION_SYNTAX_MATCH( usage ) \
444 (!((usage) & SLAP_MR_VALUE_SYNTAX_MATCH))
445 #define SLAP_IS_MR_VALUE_SYNTAX_MATCH( usage ) \
446 ((usage) & SLAP_MR_VALUE_SYNTAX_MATCH)
448 #define SLAP_IS_MR_VALUE_SYNTAX_CONVERTED_MATCH( usage ) \
449 (((usage) & SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH) \
450 == SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH)
451 #define SLAP_IS_MR_VALUE_SYNTAX_NONCONVERTED_MATCH( usage ) \
452 (((usage) & SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH) \
453 == SLAP_MR_VALUE_SYNTAX_MATCH)
456 slap_mr_convert_func *smr_convert;
457 slap_mr_normalize_func *smr_normalize;
458 slap_mr_match_func *smr_match;
459 slap_mr_indexer_func *smr_indexer;
460 slap_mr_filter_func *smr_filter;
463 * null terminated list of syntaxes compatible with this syntax
464 * note: when MS_EXT is set, this MUST NOT contain the assertion
465 * syntax of the rule. When MS_EXT is not set, it MAY.
467 Syntax **smr_compat_syntaxes;
469 struct slap_matching_rule *smr_associated;
470 struct slap_matching_rule *smr_next;
472 #define smr_oid smr_mrule.mr_oid
473 #define smr_names smr_mrule.mr_names
474 #define smr_desc smr_mrule.mr_desc
475 #define smr_obsolete smr_mrule.mr_obsolete
476 #define smr_syntax_oid smr_mrule.mr_syntax_oid
477 #define smr_extensions smr_mrule.mr_extensions
480 struct slap_matching_rule_use {
481 LDAPMatchingRuleUse smru_mruleuse;
482 MatchingRule *smru_mr;
483 /* RFC2252 string representation */
484 struct berval smru_str;
486 struct slap_matching_rule_use *smru_next;
488 #define smru_oid smru_mruleuse.mru_oid
489 #define smru_names smru_mruleuse.mru_names
490 #define smru_desc smru_mruleuse.mru_desc
491 #define smru_obsolete smru_mruleuse.mru_obsolete
492 #define smru_applies_oids smru_mruleuse.mru_applies_oids
494 #define smru_usage smru_mr->smr_usage
495 } /* MatchingRuleUse */ ;
497 typedef struct slap_mrule_defs_rec {
499 slap_mask_t mrd_usage;
500 char ** mrd_compat_syntaxes;
501 slap_mr_convert_func * mrd_convert;
502 slap_mr_normalize_func * mrd_normalize;
503 slap_mr_match_func * mrd_match;
504 slap_mr_indexer_func * mrd_indexer;
505 slap_mr_filter_func * mrd_filter;
507 char * mrd_associated;
508 } slap_mrule_defs_rec;
510 struct slap_backend_db;
514 typedef int (AttributeTypeSchemaCheckFN)(
515 struct slap_backend_db *be,
516 struct slap_entry *e,
517 struct slap_attr *attr,
519 char *textbuf, size_t textlen );
521 typedef struct slap_attribute_type {
522 LDAPAttributeType sat_atype;
523 struct berval sat_cname;
524 struct slap_attribute_type *sat_sup;
525 struct slap_attribute_type **sat_subtypes;
526 MatchingRule *sat_equality;
527 MatchingRule *sat_approx;
528 MatchingRule *sat_ordering;
529 MatchingRule *sat_substr;
532 AttributeTypeSchemaCheckFN *sat_check;
534 #define SLAP_AT_NONE 0x0000U
535 #define SLAP_AT_ABSTRACT 0x0100U /* cannot be instantiated */
536 #define SLAP_AT_FINAL 0x0200U /* cannot be subtyped */
537 #define SLAP_AT_HIDE 0x8000U /* hide attribute */
538 slap_mask_t sat_flags;
540 struct slap_attribute_type *sat_next;
542 #define sat_oid sat_atype.at_oid
543 #define sat_names sat_atype.at_names
544 #define sat_desc sat_atype.at_desc
545 #define sat_obsolete sat_atype.at_obsolete
546 #define sat_sup_oid sat_atype.at_sup_oid
547 #define sat_equality_oid sat_atype.at_equality_oid
548 #define sat_ordering_oid sat_atype.at_ordering_oid
549 #define sat_substr_oid sat_atype.at_substr_oid
550 #define sat_syntax_oid sat_atype.at_syntax_oid
551 #define sat_single_value sat_atype.at_single_value
552 #define sat_collective sat_atype.at_collective
553 #define sat_no_user_mod sat_atype.at_no_user_mod
554 #define sat_usage sat_atype.at_usage
555 #define sat_extensions sat_atype.at_extensions
557 struct slap_attr_desc *sat_ad;
558 ldap_pvt_thread_mutex_t sat_ad_mutex;
561 #define is_at_operational(at) ((at)->sat_usage)
562 #define is_at_single_value(at) ((at)->sat_single_value)
563 #define is_at_collective(at) ((at)->sat_collective)
564 #define is_at_obsolete(at) ((at)->sat_obsolete)
565 #define is_at_no_user_mod(at) ((at)->sat_no_user_mod)
567 struct slap_object_class;
569 typedef int (ObjectClassSchemaCheckFN)(
570 struct slap_backend_db *be,
571 struct slap_entry *e,
572 struct slap_object_class *oc,
574 char *textbuf, size_t textlen );
576 typedef struct slap_object_class {
577 LDAPObjectClass soc_oclass;
578 struct berval soc_cname;
579 struct slap_object_class **soc_sups;
580 AttributeType **soc_required;
581 AttributeType **soc_allowed;
582 ObjectClassSchemaCheckFN *soc_check;
583 slap_mask_t soc_flags;
584 #define soc_oid soc_oclass.oc_oid
585 #define soc_names soc_oclass.oc_names
586 #define soc_desc soc_oclass.oc_desc
587 #define soc_obsolete soc_oclass.oc_obsolete
588 #define soc_sup_oids soc_oclass.oc_sup_oids
589 #define soc_kind soc_oclass.oc_kind
590 #define soc_at_oids_must soc_oclass.oc_at_oids_must
591 #define soc_at_oids_may soc_oclass.oc_at_oids_may
592 #define soc_extensions soc_oclass.oc_extensions
594 struct slap_object_class *soc_next;
597 #define SLAP_OC_ALIAS 0x0001
598 #define SLAP_OC_REFERRAL 0x0002
599 #define SLAP_OC_SUBENTRY 0x0004
600 #define SLAP_OC_DYNAMICOBJECT 0x0008
601 #define SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY 0x0010
602 #define SLAP_OC__MASK 0x001F
603 #define SLAP_OC__END 0x0020
604 #define SLAP_OC_OPERATIONAL 0x4000
605 #define SLAP_OC_HIDE 0x8000
610 typedef struct slap_content_rule {
611 LDAPContentRule scr_crule;
612 ObjectClass *scr_sclass;
613 ObjectClass **scr_auxiliaries; /* optional */
614 AttributeType **scr_required; /* optional */
615 AttributeType **scr_allowed; /* optional */
616 AttributeType **scr_precluded; /* optional */
617 #define scr_oid scr_crule.cr_oid
618 #define scr_names scr_crule.cr_names
619 #define scr_desc scr_crule.cr_desc
620 #define scr_obsolete scr_crule.cr_obsolete
621 #define scr_oc_oids_aux scr_crule.cr_oc_oids_aux
622 #define scr_at_oids_must scr_crule.cr_at_oids_must
623 #define scr_at_oids_may scr_crule.cr_at_oids_may
624 #define scr_at_oids_not scr_crule.cr_at_oids_not
626 struct slap_content_rule *scr_next;
630 * represents a recognized attribute description ( type + options )
632 typedef struct slap_attr_desc {
633 struct slap_attr_desc *ad_next;
634 AttributeType *ad_type; /* attribute type, must be specified */
635 struct berval ad_cname; /* canonical name, must be specified */
636 struct berval ad_lang; /* empty if no language tags */
638 #define SLAP_DESC_NONE 0x00U
639 #define SLAP_DESC_BINARY 0x01U
640 #define SLAP_DESC_LANG_RANGE 0x80U
641 } AttributeDescription;
643 typedef struct slap_attr_name {
644 struct berval an_name;
645 AttributeDescription *an_desc;
649 #define slap_ad_is_lang(ad) ( (ad)->ad_lang.bv_len != 0 )
650 #define slap_ad_is_lang_range(ad) \
651 ( ((ad)->ad_flags & SLAP_DESC_LANG_RANGE) ? 1 : 0 )
652 #define slap_ad_is_binary(ad) \
653 ( ((ad)->ad_flags & SLAP_DESC_BINARY) ? 1 : 0 )
656 * pointers to schema elements used internally
658 struct slap_internal_schema {
660 ObjectClass *si_oc_top;
661 ObjectClass *si_oc_extensibleObject;
662 ObjectClass *si_oc_alias;
663 ObjectClass *si_oc_referral;
664 ObjectClass *si_oc_rootdse;
665 ObjectClass *si_oc_subentry;
666 ObjectClass *si_oc_subschema;
667 ObjectClass *si_oc_monitor;
668 ObjectClass *si_oc_collectiveAttributeSubentry;
669 ObjectClass *si_oc_dynamicObject;
671 /* objectClass attribute descriptions */
672 AttributeDescription *si_ad_objectClass;
674 /* operational attribute descriptions */
675 AttributeDescription *si_ad_structuralObjectClass;
676 AttributeDescription *si_ad_creatorsName;
677 AttributeDescription *si_ad_createTimestamp;
678 AttributeDescription *si_ad_modifiersName;
679 AttributeDescription *si_ad_modifyTimestamp;
680 AttributeDescription *si_ad_hasSubordinates;
681 AttributeDescription *si_ad_subschemaSubentry;
682 AttributeDescription *si_ad_collectiveSubentries;
683 AttributeDescription *si_ad_collectiveExclusions;
684 AttributeDescription *si_ad_entryUUID;
685 AttributeDescription *si_ad_entryCSN;
686 AttributeDescription *si_ad_superiorUUID;
688 /* root DSE attribute descriptions */
689 AttributeDescription *si_ad_altServer;
690 AttributeDescription *si_ad_namingContexts;
691 AttributeDescription *si_ad_supportedControl;
692 AttributeDescription *si_ad_supportedExtension;
693 AttributeDescription *si_ad_supportedLDAPVersion;
694 AttributeDescription *si_ad_supportedSASLMechanisms;
695 AttributeDescription *si_ad_supportedFeatures;
696 AttributeDescription *si_ad_monitorContext;
697 AttributeDescription *si_ad_vendorName;
698 AttributeDescription *si_ad_vendorVersion;
700 /* subentry attribute descriptions */
701 AttributeDescription *si_ad_administrativeRole;
702 AttributeDescription *si_ad_subtreeSpecification;
704 /* subschema subentry attribute descriptions */
705 AttributeDescription *si_ad_ditStructureRules;
706 AttributeDescription *si_ad_ditContentRules;
707 AttributeDescription *si_ad_nameForms;
708 AttributeDescription *si_ad_objectClasses;
709 AttributeDescription *si_ad_attributeTypes;
710 AttributeDescription *si_ad_ldapSyntaxes;
711 AttributeDescription *si_ad_matchingRules;
712 AttributeDescription *si_ad_matchingRuleUse;
714 /* Aliases & Referrals */
715 AttributeDescription *si_ad_aliasedObjectName;
716 AttributeDescription *si_ad_ref;
718 /* Access Control Internals */
719 AttributeDescription *si_ad_entry;
720 AttributeDescription *si_ad_children;
721 AttributeDescription *si_ad_saslAuthzTo;
722 AttributeDescription *si_ad_saslAuthzFrom;
723 #ifdef SLAPD_ACI_ENABLED
724 AttributeDescription *si_ad_aci;
727 /* dynamic entries */
728 AttributeDescription *si_ad_entryTtl;
729 AttributeDescription *si_ad_dynamicSubtrees;
731 /* Other attributes descriptions */
732 AttributeDescription *si_ad_distinguishedName;
733 AttributeDescription *si_ad_name;
734 AttributeDescription *si_ad_cn;
735 AttributeDescription *si_ad_userPassword;
736 #ifdef SLAPD_AUTHPASSWD
737 AttributeDescription *si_ad_authPassword;
739 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
740 AttributeDescription *si_ad_krbName;
743 /* Undefined Attribute Type */
744 AttributeType *si_at_undefined;
747 MatchingRule *si_mr_distinguishedNameMatch;
748 MatchingRule *si_mr_integerMatch;
751 Syntax *si_syn_octetString;
752 Syntax *si_syn_distinguishedName;
753 Syntax *si_syn_integer;
756 typedef struct slap_attr_assertion {
757 AttributeDescription *aa_desc;
758 struct berval aa_value;
759 } AttributeAssertion;
761 typedef struct slap_ss_assertion {
762 AttributeDescription *sa_desc;
763 struct berval sa_initial;
764 struct berval *sa_any;
765 struct berval sa_final;
766 } SubstringsAssertion;
768 typedef struct slap_mr_assertion {
769 MatchingRule *ma_rule; /* optional */
770 struct berval ma_rule_text; /* optional */
771 AttributeDescription *ma_desc; /* optional */
772 int ma_dnattrs; /* boolean */
773 struct berval ma_value; /* required */
774 } MatchingRuleAssertion;
777 * represents a search filter
779 typedef struct slap_filter {
780 ber_tag_t f_choice; /* values taken from ldap.h, plus: */
781 #define SLAPD_FILTER_COMPUTED ((ber_tag_t) -1)
782 #define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
783 #define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
786 /* precomputed result */
787 ber_int_t f_un_result;
790 struct berval *f_un_dn;
793 AttributeDescription *f_un_desc;
795 /* simple value assertion */
796 AttributeAssertion *f_un_ava;
798 /* substring assertion */
799 SubstringsAssertion *f_un_ssa;
801 /* matching rule assertion */
802 MatchingRuleAssertion *f_un_mra;
804 #define f_dn f_un.f_un_dn
805 #define f_desc f_un.f_un_desc
806 #define f_ava f_un.f_un_ava
807 #define f_av_desc f_un.f_un_ava->aa_desc
808 #define f_av_value f_un.f_un_ava->aa_value
809 #define f_sub f_un.f_un_ssa
810 #define f_sub_desc f_un.f_un_ssa->sa_desc
811 #define f_sub_initial f_un.f_un_ssa->sa_initial
812 #define f_sub_any f_un.f_un_ssa->sa_any
813 #define f_sub_final f_un.f_un_ssa->sa_final
814 #define f_mra f_un.f_un_mra
815 #define f_mr_rule f_un.f_un_mra->ma_rule
816 #define f_mr_rule_text f_un.f_un_mra->ma_rule_text
817 #define f_mr_desc f_un.f_un_mra->ma_desc
818 #define f_mr_value f_un.f_un_mra->ma_value
819 #define f_mr_dnattrs f_un.f_un_mra->ma_dnattrs
822 struct slap_filter *f_un_complex;
825 #define f_result f_un.f_un_result
826 #define f_and f_un.f_un_complex
827 #define f_or f_un.f_un_complex
828 #define f_not f_un.f_un_complex
829 #define f_list f_un.f_un_complex
831 struct slap_filter *f_next;
834 /* compare routines can return undefined */
835 #define SLAPD_COMPARE_UNDEFINED ((ber_int_t) -1)
837 typedef struct slap_valuesreturnfilter {
841 /* precomputed result */
842 ber_int_t f_un_result;
848 AttributeDescription *f_un_desc;
850 /* simple value assertion */
851 AttributeAssertion *f_un_ava;
853 /* substring assertion */
854 SubstringsAssertion *f_un_ssa;
856 /* matching rule assertion */
857 MatchingRuleAssertion *f_un_mra;
860 struct slap_valuesreturnfilter *f_next;
861 } ValuesReturnFilter;
864 * represents an attribute (description + values)
866 typedef struct slap_attr {
867 AttributeDescription *a_desc;
869 struct slap_attr *a_next;
871 #define SLAP_ATTR_IXADD 0x1U
872 #define SLAP_ATTR_IXDEL 0x2U
877 * the id used in the indexes to refer to an entry
879 typedef unsigned long ID;
880 #define NOID ((ID)~0)
883 * represents an entry in core
885 typedef struct slap_entry {
887 * The ID field should only be changed before entry is
888 * inserted into a cache. The ID value is backend
893 struct berval e_name; /* name (DN) of this entry */
894 struct berval e_nname; /* normalized name (DN) of this entry */
896 /* for migration purposes */
897 #define e_dn e_name.bv_val
898 #define e_ndn e_nname.bv_val
900 Attribute *e_attrs; /* list of attributes + values */
902 slap_mask_t e_ocflags;
904 struct berval e_bv; /* For entry_encode/entry_decode */
906 /* for use by the backend for any purpose */
913 typedef struct slap_mod {
915 AttributeDescription *sm_desc;
916 struct berval sm_type;
917 BerVarray sm_bvalues;
920 typedef struct slap_mod_list {
921 Modification sml_mod;
922 #define sml_op sml_mod.sm_op
923 #define sml_desc sml_mod.sm_desc
924 #define sml_type sml_mod.sm_type
925 #define sml_bvalues sml_mod.sm_bvalues
926 struct slap_mod_list *sml_next;
929 typedef struct slap_ldap_modlist {
931 struct slap_ldap_modlist *ml_next;
932 #define ml_op ml_mod.mod_op
933 #define ml_type ml_mod.mod_type
934 #define ml_values ml_mod.mod_values
935 #define ml_bvalues ml_mod.mod_bvalues
939 * represents an access control list
941 typedef enum slap_access_e {
942 ACL_INVALID_ACCESS = -1,
951 typedef enum slap_control_e {
952 ACL_INVALID_CONTROL = 0,
958 typedef enum slap_style_e {
966 /* alternate names */
967 ACL_STYLE_EXACT = ACL_STYLE_BASE
970 typedef struct slap_authz_info {
971 ber_tag_t sai_method; /* LDAP_AUTH_* from <ldap.h> */
972 struct berval sai_mech; /* SASL Mechanism */
973 struct berval sai_dn; /* DN for reporting purposes */
974 struct berval sai_ndn; /* Normalized DN */
976 /* Security Strength Factors */
977 slap_ssf_t sai_ssf; /* Overall SSF */
978 slap_ssf_t sai_transport_ssf; /* Transport SSF */
979 slap_ssf_t sai_tls_ssf; /* TLS SSF */
980 slap_ssf_t sai_sasl_ssf; /* SASL SSF */
981 } AuthorizationInformation;
984 typedef struct slap_access {
985 slap_control_t a_type;
987 #define ACL_ACCESS2PRIV(access) (0x01U << (access))
989 #define ACL_PRIV_NONE ACL_ACCESS2PRIV( ACL_NONE )
990 #define ACL_PRIV_AUTH ACL_ACCESS2PRIV( ACL_AUTH )
991 #define ACL_PRIV_COMPARE ACL_ACCESS2PRIV( ACL_COMPARE )
992 #define ACL_PRIV_SEARCH ACL_ACCESS2PRIV( ACL_SEARCH )
993 #define ACL_PRIV_READ ACL_ACCESS2PRIV( ACL_READ )
994 #define ACL_PRIV_WRITE ACL_ACCESS2PRIV( ACL_WRITE )
996 #define ACL_PRIV_MASK 0x00ffUL
999 #define ACL_PRIV_LEVEL 0x1000UL
1000 #define ACL_PRIV_ADDITIVE 0x2000UL
1001 #define ACL_PRIV_SUBSTRACTIVE 0x4000UL
1004 #define ACL_PRIV_INVALID 0x0UL
1006 #define ACL_PRIV_ISSET(m,p) (((m) & (p)) == (p))
1007 #define ACL_PRIV_ASSIGN(m,p) do { (m) = (p); } while(0)
1008 #define ACL_PRIV_SET(m,p) do { (m) |= (p); } while(0)
1009 #define ACL_PRIV_CLR(m,p) do { (m) &= ~(p); } while(0)
1011 #define ACL_INIT(m) ACL_PRIV_ASSIGN(m, ACL_PRIV_NONE)
1012 #define ACL_INVALIDATE(m) ACL_PRIV_ASSIGN(m, ACL_PRIV_INVALID)
1014 #define ACL_GRANT(m,a) ACL_PRIV_ISSET((m),ACL_ACCESS2PRIV(a))
1016 #define ACL_IS_INVALID(m) ((m) == ACL_PRIV_INVALID)
1018 #define ACL_IS_LEVEL(m) ACL_PRIV_ISSET((m),ACL_PRIV_LEVEL)
1019 #define ACL_IS_ADDITIVE(m) ACL_PRIV_ISSET((m),ACL_PRIV_ADDITIVE)
1020 #define ACL_IS_SUBTRACTIVE(m) ACL_PRIV_ISSET((m),ACL_PRIV_SUBSTRACTIVE)
1022 #define ACL_LVL_NONE (ACL_PRIV_NONE|ACL_PRIV_LEVEL)
1023 #define ACL_LVL_AUTH (ACL_PRIV_AUTH|ACL_LVL_NONE)
1024 #define ACL_LVL_COMPARE (ACL_PRIV_COMPARE|ACL_LVL_AUTH)
1025 #define ACL_LVL_SEARCH (ACL_PRIV_SEARCH|ACL_LVL_COMPARE)
1026 #define ACL_LVL_READ (ACL_PRIV_READ|ACL_LVL_SEARCH)
1027 #define ACL_LVL_WRITE (ACL_PRIV_WRITE|ACL_LVL_READ)
1029 #define ACL_LVL(m,l) (((m)&ACL_PRIV_MASK) == ((l)&ACL_PRIV_MASK))
1030 #define ACL_LVL_IS_NONE(m) ACL_LVL((m),ACL_LVL_NONE)
1031 #define ACL_LVL_IS_AUTH(m) ACL_LVL((m),ACL_LVL_AUTH)
1032 #define ACL_LVL_IS_COMPARE(m) ACL_LVL((m),ACL_LVL_COMPARE)
1033 #define ACL_LVL_IS_SEARCH(m) ACL_LVL((m),ACL_LVL_SEARCH)
1034 #define ACL_LVL_IS_READ(m) ACL_LVL((m),ACL_LVL_READ)
1035 #define ACL_LVL_IS_WRITE(m) ACL_LVL((m),ACL_LVL_WRITE)
1037 #define ACL_LVL_ASSIGN_NONE(m) ACL_PRIV_ASSIGN((m),ACL_LVL_NONE)
1038 #define ACL_LVL_ASSIGN_AUTH(m) ACL_PRIV_ASSIGN((m),ACL_LVL_AUTH)
1039 #define ACL_LVL_ASSIGN_COMPARE(m) ACL_PRIV_ASSIGN((m),ACL_LVL_COMPARE)
1040 #define ACL_LVL_ASSIGN_SEARCH(m) ACL_PRIV_ASSIGN((m),ACL_LVL_SEARCH)
1041 #define ACL_LVL_ASSIGN_READ(m) ACL_PRIV_ASSIGN((m),ACL_LVL_READ)
1042 #define ACL_LVL_ASSIGN_WRITE(m) ACL_PRIV_ASSIGN((m),ACL_LVL_WRITE)
1044 slap_mask_t a_access_mask;
1046 AuthorizationInformation a_authz;
1047 #define a_dn_pat a_authz.sai_dn
1049 slap_style_t a_dn_style;
1050 AttributeDescription *a_dn_at;
1054 slap_style_t a_peername_style;
1055 struct berval a_peername_pat;
1056 slap_style_t a_sockname_style;
1057 struct berval a_sockname_pat;
1059 slap_style_t a_domain_style;
1060 struct berval a_domain_pat;
1061 int a_domain_expand;
1063 slap_style_t a_sockurl_style;
1064 struct berval a_sockurl_pat;
1065 slap_style_t a_set_style;
1066 struct berval a_set_pat;
1068 #ifdef SLAPD_ACI_ENABLED
1069 AttributeDescription *a_aci_at;
1073 slap_style_t a_group_style;
1074 struct berval a_group_pat;
1075 ObjectClass *a_group_oc;
1076 AttributeDescription *a_group_at;
1078 struct slap_access *a_next;
1082 typedef struct slap_acl {
1083 /* "to" part: the entries this acl applies to */
1085 slap_style_t acl_dn_style;
1087 struct berval acl_dn_pat;
1088 AttributeName *acl_attrs;
1090 /* "by" part: list of who has what access to the entries */
1093 struct slap_acl *acl_next;
1096 typedef struct slap_acl_state {
1097 unsigned as_recorded;
1098 #define ACL_STATE_NOT_RECORDED 0x0
1099 #define ACL_STATE_RECORDED_VD 0x1
1100 #define ACL_STATE_RECORDED_NV 0x2
1101 #define ACL_STATE_RECORDED 0x3
1104 AccessControl *as_vd_acl;
1105 AccessControl *as_vi_acl;
1106 slap_mask_t as_vd_acl_mask;
1107 regmatch_t as_vd_acl_matches[MAXREMATCHES];
1108 int as_vd_acl_count;
1110 Access *as_vd_access;
1111 int as_vd_access_count;
1114 AttributeDescription *as_vd_ad;
1115 } AccessControlState;
1116 #define ACL_STATE_INIT { ACL_STATE_NOT_RECORDED, NULL, NULL, 0UL, { { 0, 0 } }, 0, NULL, 0, 0, 0, NULL }
1119 * replog moddn param structure
1121 struct slap_replog_moddn {
1122 struct berval *newrdn;
1124 struct berval *newsup;
1129 * represents a backend
1132 typedef struct slap_backend_info BackendInfo; /* per backend type */
1133 typedef struct slap_backend_db BackendDB; /* per backend database */
1135 LDAP_SLAPD_V (int) nBackendInfo;
1136 LDAP_SLAPD_V (int) nBackendDB;
1137 LDAP_SLAPD_V (BackendInfo *) backendInfo;
1138 LDAP_SLAPD_V (BackendDB *) backendDB;
1140 LDAP_SLAPD_V (int) slapMode;
1141 #define SLAP_UNDEFINED_MODE 0x0000
1142 #define SLAP_SERVER_MODE 0x0001
1143 #define SLAP_TOOL_MODE 0x0002
1144 #define SLAP_MODE 0x0003
1146 #define SLAP_TRUNCATE_MODE 0x0100
1148 struct slap_replica_info {
1149 char *ri_host; /* supersedes be_replica */
1150 BerVarray ri_nsuffix; /* array of suffixes this replica accepts */
1151 AttributeName *ri_attrs; /* attrs to replicate, NULL=all */
1152 int ri_exclude; /* 1 => exclude ri_attrs */
1155 struct slap_limits_set {
1163 int lms_s_unchecked;
1168 struct slap_limits {
1169 int lm_type; /* type of pattern */
1170 #define SLAP_LIMITS_UNDEFINED 0x0000
1171 #define SLAP_LIMITS_EXACT 0x0001
1172 #define SLAP_LIMITS_BASE SLAP_LIMITS_EXACT
1173 #define SLAP_LIMITS_ONE 0x0002
1174 #define SLAP_LIMITS_SUBTREE 0x0003
1175 #define SLAP_LIMITS_CHILDREN 0x0004
1176 #define SLAP_LIMITS_REGEX 0x0005
1177 #define SLAP_LIMITS_ANONYMOUS 0x0006
1178 #define SLAP_LIMITS_USERS 0x0007
1179 #define SLAP_LIMITS_ANY 0x0008
1180 regex_t lm_dn_regex; /* regex data for REGEX */
1183 * normalized DN for EXACT, BASE, ONE, SUBTREE, CHILDREN;
1184 * pattern for REGEX; NULL for ANONYMOUS, USERS
1186 struct berval lm_dn_pat;
1188 struct slap_limits_set lm_limits;
1191 /* temporary aliases */
1192 typedef BackendDB Backend;
1193 #define nbackends nBackendDB
1194 #define backends backendDB
1196 struct slap_backend_db {
1197 BackendInfo *bd_info; /* pointer to shared backend info */
1199 /* BackendInfo accessors */
1200 #define be_config bd_info->bi_db_config
1201 #define be_type bd_info->bi_type
1203 #define be_bind bd_info->bi_op_bind
1204 #define be_unbind bd_info->bi_op_unbind
1205 #define be_add bd_info->bi_op_add
1206 #define be_compare bd_info->bi_op_compare
1207 #define be_delete bd_info->bi_op_delete
1208 #define be_modify bd_info->bi_op_modify
1209 #define be_modrdn bd_info->bi_op_modrdn
1210 #define be_search bd_info->bi_op_search
1212 #define be_extended bd_info->bi_extended
1214 #define be_release bd_info->bi_entry_release_rw
1215 #define be_chk_referrals bd_info->bi_chk_referrals
1216 #define be_group bd_info->bi_acl_group
1217 #define be_attribute bd_info->bi_acl_attribute
1218 #define be_operational bd_info->bi_operational
1221 * define to honor hasSubordinates operational attribute in search filters
1222 * (in previous use there was a flaw with back-bdb and back-ldbm; now it
1226 #define be_has_subordinates bd_info->bi_has_subordinates
1228 #define be_controls bd_info->bi_controls
1230 #define be_connection_init bd_info->bi_connection_init
1231 #define be_connection_destroy bd_info->bi_connection_destroy
1234 #define be_entry_open bd_info->bi_tool_entry_open
1235 #define be_entry_close bd_info->bi_tool_entry_close
1236 #define be_entry_first bd_info->bi_tool_entry_first
1237 #define be_entry_next bd_info->bi_tool_entry_next
1238 #define be_entry_reindex bd_info->bi_tool_entry_reindex
1239 #define be_entry_get bd_info->bi_tool_entry_get
1240 #define be_entry_put bd_info->bi_tool_entry_put
1241 #define be_sync bd_info->bi_tool_sync
1244 #define SLAP_BFLAG_NOLASTMOD 0x0001U
1245 #define SLAP_BFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */
1246 #define SLAP_BFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
1247 #define SLAP_BFLAG_GLUE_LINKED 0x0040U /* child is connected to parent */
1248 #define SLAP_BFLAG_ALIASES 0x0100U
1249 #define SLAP_BFLAG_REFERRALS 0x0200U
1250 #define SLAP_BFLAG_SUBENTRIES 0x0400U
1251 #define SLAP_BFLAG_MONITOR 0x1000U
1252 #define SLAP_BFLAG_DYNAMIC 0x2000U
1253 slap_mask_t be_flags;
1254 #define SLAP_LASTMOD(be) (!((be)->be_flags & SLAP_BFLAG_NOLASTMOD))
1255 #define SLAP_ALIASES(be) ((be)->be_flags & SLAP_BFLAG_ALIASES)
1256 #define SLAP_REFERRALS(be) ((be)->be_flags & SLAP_BFLAG_REFERRALS)
1257 #define SLAP_SUBENTRIES(be) ((be)->be_flags & SLAP_BFLAG_SUBENTRIES)
1258 #define SLAP_MONITOR(be) ((be)->be_flags & SLAP_BFLAG_MONITOR)
1259 #define SLAP_DYNAMIC(be) ((be)->be_flags & SLAP_BFLAG_DYNAMIC)
1261 slap_mask_t be_restrictops; /* restriction operations */
1262 #define SLAP_RESTRICT_OP_ADD 0x0001U
1263 #define SLAP_RESTRICT_OP_BIND 0x0002U
1264 #define SLAP_RESTRICT_OP_COMPARE 0x0004U
1265 #define SLAP_RESTRICT_OP_DELETE 0x0008U
1266 #define SLAP_RESTRICT_OP_EXTENDED 0x0010U
1267 #define SLAP_RESTRICT_OP_MODIFY 0x0020U
1268 #define SLAP_RESTRICT_OP_RENAME 0x0040U
1269 #define SLAP_RESTRICT_OP_SEARCH 0x0080U
1271 #define SLAP_RESTRICT_OP_READS \
1272 ( SLAP_RESTRICT_OP_COMPARE \
1273 | SLAP_RESTRICT_OP_SEARCH )
1274 #define SLAP_RESTRICT_OP_WRITES \
1275 ( SLAP_RESTRICT_OP_ADD \
1276 | SLAP_RESTRICT_OP_DELETE \
1277 | SLAP_RESTRICT_OP_MODIFY \
1278 | SLAP_RESTRICT_OP_RENAME )
1280 #define SLAP_ALLOW_BIND_V2 0x0001U /* LDAPv2 bind */
1281 #define SLAP_ALLOW_BIND_ANON_CRED 0x0002U /* cred should be empty */
1282 #define SLAP_ALLOW_BIND_ANON_DN 0x0004U /* dn should be empty */
1284 #define SLAP_ALLOW_UPDATE_ANON 0x0008U /* allow anonymous updates */
1286 #define SLAP_DISALLOW_BIND_ANON 0x0001U /* no anonymous */
1287 #define SLAP_DISALLOW_BIND_SIMPLE 0x0002U /* simple authentication */
1288 #define SLAP_DISALLOW_BIND_SIMPLE_UNPROTECTED \
1289 0x0004U /* unprotected simple auth */
1290 #define SLAP_DISALLOW_BIND_KRBV4 0x0008U /* Kerberos V4 authentication */
1292 #define SLAP_DISALLOW_TLS_2_ANON 0x0010U /* StartTLS -> Anonymous */
1293 #define SLAP_DISALLOW_TLS_AUTHC 0x0020U /* TLS while authenticated */
1295 #define SLAP_DISALLOW_AUX_WO_CR 0x4000U
1297 slap_mask_t be_requires; /* pre-operation requirements */
1298 #define SLAP_REQUIRE_BIND 0x0001U /* bind before op */
1299 #define SLAP_REQUIRE_LDAP_V3 0x0002U /* LDAPv3 before op */
1300 #define SLAP_REQUIRE_AUTHC 0x0004U /* authentication before op */
1301 #define SLAP_REQUIRE_SASL 0x0008U /* SASL before op */
1302 #define SLAP_REQUIRE_STRONG 0x0010U /* strong authentication before op */
1304 /* Required Security Strength Factor */
1305 slap_ssf_set_t be_ssf_set;
1307 /* these should be renamed from be_ to bd_ */
1308 BerVarray be_suffix; /* the DN suffixes of data in this backend */
1309 BerVarray be_nsuffix; /* the normalized DN suffixes in this backend */
1310 BerVarray be_suffixAlias; /* pairs of DN suffix aliases and deref values */
1311 struct berval be_schemadn; /* per-backend subschema subentry DN */
1312 struct berval be_schemandn; /* normalized subschema DN */
1313 struct berval be_rootdn; /* the magic "root" name (DN) for this db */
1314 struct berval be_rootndn; /* the magic "root" normalized name (DN) for this db */
1315 struct berval be_rootpw; /* the magic "root" password for this db */
1316 unsigned int be_max_deref_depth; /* limit for depth of an alias deref */
1317 #define be_sizelimit be_def_limit.lms_s_soft
1318 #define be_timelimit be_def_limit.lms_t_soft
1319 struct slap_limits_set be_def_limit; /* default limits */
1320 struct slap_limits **be_limits; /* regex-based size and time limits */
1321 AccessControl *be_acl; /* access control list for this backend */
1322 slap_access_t be_dfltaccess; /* access given if no acl matches */
1323 struct slap_replica_info **be_replica; /* replicas of this backend (in master) */
1324 char *be_replogfile; /* replication log file (in master) */
1325 struct berval be_update_ndn; /* allowed to make changes (in replicas) */
1326 BerVarray be_update_refs; /* where to refer modifying clients to */
1328 void *be_private; /* anything the backend database needs */
1334 /* Backend function typedefs */
1335 typedef int (BI_init) LDAP_P((BackendInfo *bi));
1336 typedef int (BI_config) LDAP_P((BackendInfo *bi,
1337 const char *fname, int lineno,
1338 int argc, char **argv));
1339 typedef int (BI_open) LDAP_P((BackendInfo *bi));
1340 typedef int (BI_close) LDAP_P((BackendInfo *bi));
1341 typedef int (BI_destroy) LDAP_P((BackendInfo *bi));
1343 typedef int (BI_db_init) LDAP_P((Backend *bd));
1344 typedef int (BI_db_config) LDAP_P((Backend *bd,
1345 const char *fname, int lineno,
1346 int argc, char **argv));
1347 typedef int (BI_db_open) LDAP_P((Backend *bd));
1348 typedef int (BI_db_close) LDAP_P((Backend *bd));
1349 typedef int (BI_db_destroy) LDAP_P((Backend *bd));
1351 typedef int (BI_op_bind) LDAP_P(( BackendDB *bd,
1352 struct slap_conn *c, struct slap_op *o,
1353 struct berval *dn, struct berval *ndn, int method,
1354 struct berval *cred, struct berval *edn ));
1355 typedef int (BI_op_unbind) LDAP_P((BackendDB *bd,
1356 struct slap_conn *c, struct slap_op *o ));
1357 typedef int (BI_op_search) LDAP_P((BackendDB *bd,
1358 struct slap_conn *c, struct slap_op *o,
1359 struct berval *base, struct berval *nbase,
1360 int scope, int deref,
1361 int slimit, int tlimit,
1362 Filter *f, struct berval *filterstr,
1363 AttributeName *attrs, int attrsonly));
1364 typedef int (BI_op_compare)LDAP_P((BackendDB *bd,
1365 struct slap_conn *c, struct slap_op *o,
1366 struct berval *dn, struct berval *ndn,
1367 AttributeAssertion *ava));
1368 typedef int (BI_op_modify) LDAP_P((BackendDB *bd,
1369 struct slap_conn *c, struct slap_op *o,
1370 struct berval *dn, struct berval *ndn,
1372 typedef int (BI_op_modrdn) LDAP_P((BackendDB *bd,
1373 struct slap_conn *c, struct slap_op *o,
1374 struct berval *dn, struct berval *ndn,
1375 struct berval *newrdn, struct berval *nnewrdn,
1377 struct berval *newSup, struct berval *nnewSup ));
1378 typedef int (BI_op_add) LDAP_P((BackendDB *bd,
1379 struct slap_conn *c, struct slap_op *o,
1381 typedef int (BI_op_delete) LDAP_P((BackendDB *bd,
1382 struct slap_conn *c, struct slap_op *o,
1383 struct berval *dn, struct berval *ndn));
1384 typedef int (BI_op_abandon) LDAP_P((BackendDB *bd,
1385 struct slap_conn *c, struct slap_op *o,
1388 typedef int (BI_op_extended) LDAP_P((
1390 struct slap_conn *conn,
1393 struct berval * reqdata,
1395 struct berval ** rspdata,
1396 LDAPControl *** rspctrls,
1400 typedef int (BI_entry_release_rw) LDAP_P((BackendDB *bd,
1401 struct slap_conn *c, struct slap_op *o,
1404 typedef int (BI_chk_referrals) LDAP_P((BackendDB *bd,
1405 struct slap_conn *c, struct slap_op *o,
1406 struct berval *dn, struct berval *ndn,
1407 const char **text ));
1409 typedef int (BI_acl_group) LDAP_P((Backend *bd,
1410 struct slap_conn *c, struct slap_op *o,
1414 ObjectClass *group_oc,
1415 AttributeDescription *group_at ));
1417 typedef int (BI_acl_attribute) LDAP_P((Backend *bd,
1418 struct slap_conn *c, struct slap_op *o,
1419 Entry *e, struct berval *edn,
1420 AttributeDescription *entry_at,
1423 typedef int (BI_operational) LDAP_P((Backend *bd,
1424 struct slap_conn *c, struct slap_op *o,
1425 Entry *e, AttributeName *attrs, int opattrs, Attribute **a ));
1427 typedef int (BI_has_subordinates) LDAP_P((Backend *bd,
1428 struct slap_conn *c, struct slap_op *o,
1429 Entry *e, int *has_subordinates ));
1431 typedef int (BI_connection_init) LDAP_P((BackendDB *bd,
1432 struct slap_conn *c));
1433 typedef int (BI_connection_destroy) LDAP_P((BackendDB *bd,
1434 struct slap_conn *c));
1436 typedef int (BI_tool_entry_open) LDAP_P(( BackendDB *be, int mode ));
1437 typedef int (BI_tool_entry_close) LDAP_P(( BackendDB *be ));
1438 typedef ID (BI_tool_entry_first) LDAP_P(( BackendDB *be ));
1439 typedef ID (BI_tool_entry_next) LDAP_P(( BackendDB *be ));
1440 typedef Entry* (BI_tool_entry_get) LDAP_P(( BackendDB *be, ID id ));
1441 typedef ID (BI_tool_entry_put) LDAP_P(( BackendDB *be, Entry *e,
1442 struct berval *text ));
1443 typedef int (BI_tool_entry_reindex) LDAP_P(( BackendDB *be, ID id ));
1444 typedef int (BI_tool_sync) LDAP_P(( BackendDB *be ));
1446 struct slap_backend_info {
1447 char *bi_type; /* type of backend */
1450 * per backend type routines:
1451 * bi_init: called to allocate a backend_info structure,
1452 * called once BEFORE configuration file is read.
1453 * bi_init() initializes this structure hence is
1454 * called directly from be_initialize()
1455 * bi_config: called per 'backend' specific option
1456 * all such options must before any 'database' options
1457 * bi_config() is called only from read_config()
1458 * bi_open: called to open each database, called
1459 * once AFTER configuration file is read but
1460 * BEFORE any bi_db_open() calls.
1461 * bi_open() is called from backend_startup()
1462 * bi_close: called to close each database, called
1463 * once during shutdown after all bi_db_close calls.
1464 * bi_close() is called from backend_shutdown()
1465 * bi_destroy: called to destroy each database, called
1466 * once during shutdown after all bi_db_destroy calls.
1467 * bi_destory() is called from backend_destroy()
1470 BI_config *bi_config;
1473 BI_destroy *bi_destroy;
1476 * per database routines:
1477 * bi_db_init: called to initialize each database,
1478 * called upon reading 'database <type>'
1479 * called only from backend_db_init()
1480 * bi_db_config: called to configure each database,
1481 * called per database to handle per database options
1482 * called only from read_config()
1483 * bi_db_open: called to open each database
1484 * called once per database immediately AFTER bi_open()
1485 * calls but before daemon startup.
1486 * called only by backend_startup()
1487 * bi_db_close: called to close each database
1488 * called once per database during shutdown but BEFORE
1489 * any bi_close call.
1490 * called only by backend_shutdown()
1491 * bi_db_destroy: called to destroy each database
1492 * called once per database during shutdown AFTER all
1493 * bi_close calls but before bi_destory calls.
1494 * called only by backend_destory()
1496 BI_db_init *bi_db_init;
1497 BI_db_config *bi_db_config;
1498 BI_db_open *bi_db_open;
1499 BI_db_close *bi_db_close;
1500 BI_db_destroy *bi_db_destroy;
1502 /* LDAP Operations Handling Routines */
1503 BI_op_bind *bi_op_bind;
1504 BI_op_unbind *bi_op_unbind;
1505 BI_op_search *bi_op_search;
1506 BI_op_compare *bi_op_compare;
1507 BI_op_modify *bi_op_modify;
1508 BI_op_modrdn *bi_op_modrdn;
1509 BI_op_add *bi_op_add;
1510 BI_op_delete *bi_op_delete;
1511 BI_op_abandon *bi_op_abandon;
1513 /* Extended Operations Helper */
1514 BI_op_extended *bi_extended;
1516 /* Auxilary Functions */
1517 BI_entry_release_rw *bi_entry_release_rw;
1518 BI_chk_referrals *bi_chk_referrals;
1520 BI_acl_group *bi_acl_group;
1521 BI_acl_attribute *bi_acl_attribute;
1523 BI_operational *bi_operational;
1524 BI_has_subordinates *bi_has_subordinates;
1526 BI_connection_init *bi_connection_init;
1527 BI_connection_destroy *bi_connection_destroy;
1529 /* hooks for slap tools */
1530 BI_tool_entry_open *bi_tool_entry_open;
1531 BI_tool_entry_close *bi_tool_entry_close;
1532 BI_tool_entry_first *bi_tool_entry_first;
1533 BI_tool_entry_next *bi_tool_entry_next;
1534 BI_tool_entry_get *bi_tool_entry_get;
1535 BI_tool_entry_put *bi_tool_entry_put;
1536 BI_tool_entry_reindex *bi_tool_entry_reindex;
1537 BI_tool_sync *bi_tool_sync;
1539 #define SLAP_INDEX_ADD_OP 0x0001
1540 #define SLAP_INDEX_DELETE_OP 0x0002
1542 char **bi_controls; /* supported controls */
1544 unsigned int bi_nDB; /* number of databases of this type */
1545 void *bi_private; /* anything the backend type needs */
1548 #define c_authtype c_authz.sai_method
1549 #define c_authmech c_authz.sai_mech
1550 #define c_dn c_authz.sai_dn
1551 #define c_ndn c_authz.sai_ndn
1552 #define c_ssf c_authz.sai_ssf
1553 #define c_transport_ssf c_authz.sai_transport_ssf
1554 #define c_tls_ssf c_authz.sai_tls_ssf
1555 #define c_sasl_ssf c_authz.sai_sasl_ssf
1557 #define o_authtype o_authz.sai_method
1558 #define o_authmech o_authz.sai_mech
1559 #define o_dn o_authz.sai_dn
1560 #define o_ndn o_authz.sai_ndn
1561 #define o_ssf o_authz.sai_ssf
1562 #define o_transport_ssf o_authz.sai_transport_ssf
1563 #define o_tls_ssf o_authz.sai_tls_ssf
1564 #define o_sasl_ssf o_authz.sai_sasl_ssf
1566 typedef void (slap_response)( struct slap_conn *, struct slap_op *,
1567 ber_tag_t, ber_int_t, ber_int_t, const char *, const char *,
1568 BerVarray, const char *, struct berval *,
1569 struct berval *, LDAPControl ** );
1571 typedef void (slap_sresult)( struct slap_conn *, struct slap_op *,
1572 ber_int_t, const char *, const char *, BerVarray,
1573 LDAPControl **, int nentries);
1575 typedef int (slap_sendentry)( BackendDB *, struct slap_conn *,
1576 struct slap_op *, Entry *, AttributeName *, int, LDAPControl **);
1578 typedef struct slap_callback {
1579 slap_response *sc_response;
1580 slap_sresult *sc_sresult;
1581 slap_sendentry *sc_sendentry;
1586 * Paged Results state
1588 typedef unsigned long PagedResultsCookie;
1589 typedef struct slap_paged_state {
1591 PagedResultsCookie ps_cookie;
1593 } PagedResultsState;
1596 #ifdef LDAP_CLIENT_UPDATE
1597 #define LCUP_PSEARCH_BY_ADD 0x01
1598 #define LCUP_PSEARCH_BY_DELETE 0x02
1599 #define LCUP_PSEARCH_BY_PREMODIFY 0x03
1600 #define LCUP_PSEARCH_BY_MODIFY 0x04
1601 #define LCUP_PSEARCH_BY_SCOPEOUT 0x05
1603 struct lcup_search_spec {
1605 struct berval *base;
1606 struct berval *nbase;
1612 struct berval *filterstr;
1613 AttributeName *attrs;
1615 struct lcup_entry *elist;
1616 ldap_pvt_thread_mutex_t elist_mutex;
1618 LDAP_LIST_ENTRY(lcup_search_spec) link;
1622 struct lcup_search_spec* ps;
1623 LDAP_LIST_ENTRY(psid_entry) link;
1625 #endif /* LDAP_CLIENT_UPDATE */
1629 * represents an operation pending from an ldap client
1631 typedef struct slap_op {
1632 unsigned long o_opid; /* id of this operation */
1633 unsigned long o_connid; /* id of conn initiating this op */
1634 struct slap_conn *o_conn; /* connection spawning this op */
1636 ber_int_t o_msgid; /* msgid of the request */
1637 ber_int_t o_protocol; /* version of the LDAP protocol used by client */
1638 ber_tag_t o_tag; /* tag of the request */
1639 time_t o_time; /* time op was initiated */
1641 char * o_extendedop; /* extended operation OID */
1643 ldap_pvt_thread_t o_tid; /* thread handling this op */
1645 volatile sig_atomic_t o_abandon; /* abandon flag */
1647 char o_do_not_cache; /* don't cache from this op */
1649 #define SLAP_NO_CONTROL 0
1650 #define SLAP_NONCRITICAL_CONTROL 1
1651 #define SLAP_CRITICAL_CONTROL 2
1656 char o_subentries_visibility;
1657 char o_valuesreturnfilter;
1659 char o_pagedresults;
1660 ber_int_t o_pagedresults_size;
1661 PagedResultsState o_pagedresults_state;
1663 #ifdef LDAP_CLIENT_UPDATE
1664 char o_clientupdate;
1665 char o_clientupdate_type;
1666 #define SLAP_LCUP_NONE (0x0)
1667 #define SLAP_LCUP_SYNC (0x1)
1668 #define SLAP_LCUP_PERSIST (0x2)
1669 #define SLAP_LCUP_SYNC_AND_PERSIST (0x3)
1670 ber_int_t o_clientupdate_interval;
1671 struct berval o_clientupdate_state;
1672 LDAP_LIST_HEAD(lss, lcup_search_spec) psearch_spec;
1673 LDAP_LIST_HEAD(pe, psid_entry) premodify_list;
1674 LDAP_LIST_ENTRY(slap_op) link;
1675 #endif /* LDAP_CLIENT_UPDATE */
1677 #ifdef LDAP_CONNECTIONLESS
1678 Sockaddr o_peeraddr; /* UDP peer address */
1680 AuthorizationInformation o_authz;
1682 BerElement *o_ber; /* ber of the request */
1683 slap_callback *o_callback; /* callback pointers */
1684 LDAPControl **o_ctrls; /* controls */
1686 void *o_threadctx; /* thread pool thread context */
1687 void *o_private; /* anything the backend needs */
1689 LDAP_STAILQ_ENTRY(slap_op) o_next; /* next operation in list */
1690 ValuesReturnFilter *vrFilter; /* Structure represents ValuesReturnFilter */
1693 #define get_manageDSAit(op) ((int)(op)->o_managedsait)
1694 #define get_subentries(op) ((int)(op)->o_subentries)
1695 #define get_subentries_visibility(op) ((int)(op)->o_subentries_visibility)
1696 #define get_pagedresults(op) ((int)(op)->o_pagedresults)
1700 * Caches the result of a backend_group check for ACL evaluation
1702 typedef struct slap_gacl {
1703 struct slap_gacl *ga_next;
1706 AttributeDescription *ga_at;
1712 typedef struct slap_listener Listener;
1715 * represents a connection from an ldap client
1717 typedef struct slap_conn {
1718 int c_struct_state; /* structure management state */
1719 int c_conn_state; /* connection state */
1721 ldap_pvt_thread_mutex_t c_mutex; /* protect the connection */
1722 Sockbuf *c_sb; /* ber connection stuff */
1724 /* only can be changed by connect_init */
1725 time_t c_starttime; /* when the connection was opened */
1726 time_t c_activitytime; /* when the connection was last used */
1727 unsigned long c_connid; /* id of this connection for stats*/
1729 struct berval c_peer_domain; /* DNS name of client */
1730 struct berval c_peer_name; /* peer name (trans=addr:port) */
1731 Listener *c_listener;
1732 #define c_listener_url c_listener->sl_url /* listener URL */
1733 #define c_sock_name c_listener->sl_name /* sock name (trans=addr:port) */
1735 /* only can be changed by binding thread */
1736 int c_sasl_bind_in_progress; /* multi-op bind in progress */
1737 struct berval c_sasl_bind_mech; /* mech in progress */
1738 struct berval c_sasl_dn; /* temporary storage */
1740 /* authorization backend */
1741 Backend *c_authz_backend;
1743 AuthorizationInformation c_authz;
1744 GroupAssertion *c_groups;
1746 ber_int_t c_protocol; /* version of the LDAP protocol used by client */
1748 LDAP_STAILQ_HEAD(c_o, slap_op) c_ops; /* list of operations being processed */
1749 LDAP_STAILQ_HEAD(c_po, slap_op) c_pending_ops; /* list of pending operations */
1751 ldap_pvt_thread_mutex_t c_write_mutex; /* only one pdu written at a time */
1752 ldap_pvt_thread_cond_t c_write_cv; /* used to wait for sd write-ready*/
1754 BerElement *c_currentber; /* ber we're attempting to read */
1755 int c_writewaiter; /* true if writer is waiting */
1757 #ifdef LDAP_CONNECTIONLESS
1758 int c_is_udp; /* true if this is (C)LDAP over UDP */
1761 int c_is_tls; /* true if this LDAP over raw TLS */
1762 int c_needs_tls_accept; /* true if SSL_accept should be called */
1764 int c_sasl_layers; /* true if we need to install SASL i/o handlers */
1765 void *c_sasl_context; /* SASL session context */
1766 void *c_sasl_extra; /* SASL session extra stuff */
1767 struct slap_op *c_sasl_bindop; /* set to current op if it's a bind */
1769 PagedResultsState c_pagedresults_state; /* paged result state */
1771 long c_n_ops_received; /* num of ops received (next op_id) */
1772 long c_n_ops_executing; /* num of ops currently executing */
1773 long c_n_ops_pending; /* num of ops pending execution */
1774 long c_n_ops_completed; /* num of ops completed */
1776 long c_n_get; /* num of get calls */
1777 long c_n_read; /* num of read calls */
1778 long c_n_write; /* num of write calls */
1781 #if defined(LDAP_SYSLOG) && defined(LDAP_DEBUG)
1782 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
1784 if ( ldap_debug & (level) ) \
1785 fprintf( stderr, (fmt), (connid), (opid), (arg1), (arg2), (arg3) );\
1786 if ( ldap_syslog & (level) ) \
1787 syslog( ldap_syslog_level, (fmt), (connid), (opid), (arg1), \
1791 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )
1795 * listener; need to access it from monitor backend
1797 struct slap_listener {
1798 struct berval sl_url;
1799 struct berval sl_name;
1804 #ifdef LDAP_CONNECTIONLESS
1805 int sl_is_udp; /* UDP listener is also data port */
1809 #define sl_addr sl_sa.sa_in_addr
1812 #ifdef SLAPD_MONITOR
1829 #endif /* SLAPD_MONITOR */
1832 * Better know these all around slapd
1834 #define SLAP_LDAPDN_PRETTY 0x1
1835 #define SLAP_LDAPDN_MAXLEN 8192
1840 #ifdef LDAP_CLIENT_UPDATE
1841 #define SLAP_LCUP_STATE_UPDATE_TRUE 1
1842 #define SLAP_LCUP_STATE_UPDATE_FALSE 0
1843 #define SLAP_LCUP_ENTRY_DELETED_TRUE 1
1844 #define SLAP_LCUP_ENTRY_DELETED_FALSE 0
1845 #endif /* LDAP_CLIENT_UPDATE */
1849 #include "proto-slap.h"
1851 #endif /* _SLAP_H_ */