/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2004 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define SLAP_TEXT_BUFLEN (256)
/* psuedo error code indicating abandoned operation */
-#define SLAPD_ABANDON (-1)
+#define SLAPD_ABANDON (-1024)
/* psuedo error code indicating disconnect */
-#define SLAPD_DISCONNECT (-2)
+#define SLAPD_DISCONNECT (-1025)
+/* unknown config file directive */
+#define SLAP_CONF_UNKNOWN (-1026)
/* We assume "C" locale, that is US-ASCII */
#define ASCII_SPACE(c) ( (c) == ' ' )
typedef struct slap_attr_name {
struct berval an_name;
AttributeDescription *an_desc;
+ int an_oc_exclude;
ObjectClass *an_oc;
} AttributeName;
AttributeDescription *si_ad_dseType;
AttributeDescription *si_ad_syncreplCookie;
+ AttributeDescription *si_ad_syncTimestamp;
AttributeDescription *si_ad_contextCSN;
/* root DSE attribute descriptions */
*/
typedef struct slap_filter {
ber_tag_t f_choice; /* values taken from ldap.h, plus: */
-#define SLAPD_FILTER_COMPUTED ((ber_tag_t) -1)
-#define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
-#define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
+#define SLAPD_FILTER_COMPUTED ((ber_tag_t) -1)
+#define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
+#define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
+#define SLAPD_FILTER_DN_CHILDREN ((ber_tag_t) -4)
union f_un_u {
/* precomputed result */
typedef enum slap_style_e {
ACL_STYLE_REGEX = 0,
+ ACL_STYLE_EXPAND,
ACL_STYLE_BASE,
ACL_STYLE_ONE,
ACL_STYLE_SUBTREE,
ACL_STYLE_CHILDREN,
- ACL_STYLE_ATTROF
+ ACL_STYLE_ATTROF,
+ ACL_STYLE_IP,
+ ACL_STYLE_PATH
} slap_style_t;
typedef struct slap_authz_info {
- ber_tag_t sai_method; /* LDAP_AUTH_* from <ldap.h> */
+ ber_tag_t sai_method; /* LDAP_AUTH_* from <ldap.h> */
struct berval sai_mech; /* SASL Mechanism */
struct berval sai_dn; /* DN for reporting purposes */
struct berval sai_ndn; /* Normalized DN */
slap_style_t a_peername_style;
struct berval a_peername_pat;
+ unsigned long a_peername_addr,
+ a_peername_mask;
+ int a_peername_port;
+
slap_style_t a_sockname_style;
struct berval a_sockname_pat;
};
struct slap_limits {
- int lm_type; /* type of pattern */
-#define SLAP_LIMITS_UNDEFINED 0x0000
-#define SLAP_LIMITS_EXACT 0x0001
-#define SLAP_LIMITS_BASE SLAP_LIMITS_EXACT
-#define SLAP_LIMITS_ONE 0x0002
-#define SLAP_LIMITS_SUBTREE 0x0003
-#define SLAP_LIMITS_CHILDREN 0x0004
-#define SLAP_LIMITS_REGEX 0x0005
-#define SLAP_LIMITS_ANONYMOUS 0x0006
-#define SLAP_LIMITS_USERS 0x0007
-#define SLAP_LIMITS_ANY 0x0008
- regex_t lm_dn_regex; /* regex data for REGEX */
+ unsigned lm_flags; /* type of pattern */
+#define SLAP_LIMITS_UNDEFINED 0x0000U
+#define SLAP_LIMITS_EXACT 0x0001U
+#define SLAP_LIMITS_BASE SLAP_LIMITS_EXACT
+#define SLAP_LIMITS_ONE 0x0002U
+#define SLAP_LIMITS_SUBTREE 0x0003U
+#define SLAP_LIMITS_CHILDREN 0x0004U
+#define SLAP_LIMITS_REGEX 0x0005U
+#define SLAP_LIMITS_ANONYMOUS 0x0006U
+#define SLAP_LIMITS_USERS 0x0007U
+#define SLAP_LIMITS_ANY 0x0008U
+#define SLAP_LIMITS_MASK 0x000FU
+
+#define SLAP_LIMITS_TYPE_DN 0x0000U
+#define SLAP_LIMITS_TYPE_GROUP 0x0010U
+#define SLAP_LIMITS_TYPE_MASK 0x00F0U
+
+ regex_t lm_regex; /* regex data for REGEX */
/*
* normalized DN for EXACT, BASE, ONE, SUBTREE, CHILDREN;
* pattern for REGEX; NULL for ANONYMOUS, USERS
*/
- struct berval lm_dn_pat;
+ struct berval lm_pat;
+
+ /* if lm_flags & SLAP_LIMITS_TYPE_MASK == SLAP_LIMITS_GROUP,
+ * lm_group_oc is objectClass and lm_group_at is attributeType
+ * of member in oc for match; then lm_flags & SLAP_LIMITS_MASK
+ * can only be SLAP_LIMITS_EXACT */
+ ObjectClass *lm_group_oc;
+ AttributeDescription *lm_group_ad;
struct slap_limits_set lm_limits;
};
void *be_private; /* anything the backend database needs */
void *be_pb; /* Netscape plugin */
- LDAP_TAILQ_HEAD( pcl, slap_csn_entry ) be_pending_csn_list;
+ LDAP_TAILQ_HEAD( be_pcl, slap_csn_entry ) be_pending_csn_list;
ldap_pvt_thread_mutex_t be_pcl_mutex;
struct berval be_context_csn;
ldap_pvt_thread_mutex_t be_context_csn_mutex;
int rs_deref;
int rs_slimit;
int rs_tlimit;
+ /* NULL means be_isroot evaluated to TRUE */
+ struct slap_limits_set *rs_limit;
int rs_attrsonly;
AttributeName *rs_attrs;
Filter *rs_filter;
struct berval *rs_reqdata;
} req_extended_s;
+typedef struct req_pwdexop_s {
+ struct berval rs_reqoid;
+ struct berval rs_old;
+ struct berval rs_new;
+ Modifications *rs_mods;
+ Modifications **rs_modtail;
+} req_pwdexop_s;
+
typedef enum slap_reply_e {
REP_RESULT,
REP_SASL,
typedef int (slap_response)( struct slap_op *, struct slap_rep * );
typedef struct slap_callback {
+ struct slap_callback *sc_next;
slap_response *sc_response;
+ slap_response *sc_cleanup;
void *sc_private;
} slap_callback;
req_abandon_s oq_abandon;
req_abandon_s oq_cancel;
req_extended_s oq_extended;
+ req_pwdexop_s oq_pwdexop;
} o_request;
/* short hands for union members */
#define oq_abandon o_request.oq_abandon
#define oq_cancel o_request.oq_cancel
#define oq_extended o_request.oq_extended
+#define oq_pwdexop o_request.oq_pwdexop
/* short hands for inner request members */
#define orb_method oq_bind.rb_method
#define ors_deref oq_search.rs_deref
#define ors_slimit oq_search.rs_slimit
#define ors_tlimit oq_search.rs_tlimit
+#define ors_limit oq_search.rs_limit
#define ors_attrsonly oq_search.rs_attrsonly
#define ors_attrs oq_search.rs_attrs
#define ors_filter oq_search.rs_filter
#define get_domainScope(op) ((int)(op)->o_domain_scope)
#else
#define get_domainScope(op) (0)
+#endif
+
+#ifdef LDAP_CONTROL_X_TREE_DELETE
+ char o_tree_delete;
+#define get_treeDelete(op) ((int)(op)->o_tree_delete)
+#else
+#define get_treeDelete(op) (0)
#endif
char o_preread;
AttributeName *o_preread_attrs;
AttributeName *o_postread_attrs;
-#ifdef LDAP_CONTROL_PAGEDRESULTS
char o_pagedresults;
#define get_pagedresults(op) ((int)(op)->o_pagedresults)
ber_int_t o_pagedresults_size;
PagedResultsState o_pagedresults_state;
-#else
-#define get_pagedresults(op) (0)
-#endif
char o_sync;
char o_sync_mode;
-#define SLAP_SYNC_NONE (0x0)
-#define SLAP_SYNC_REFRESH (0x1)
-#define SLAP_SYNC_PERSIST (0x2)
-#define SLAP_SYNC_REFRESH_AND_PERSIST (0x3)
+#define SLAP_SYNC_NONE LDAP_SYNC_NONE
+#define SLAP_SYNC_REFRESH LDAP_SYNC_REFRESH_ONLY
+#define SLAP_SYNC_PERSIST LDAP_SYNC_RESERVED
+#define SLAP_SYNC_REFRESH_AND_PERSIST LDAP_SYNC_REFRESH_AND_PERSIST
struct sync_cookie o_sync_state;
int o_sync_rhint;
struct berval o_sync_cid;
ValuesReturnFilter *o_vrFilter; /* ValuesReturnFilter */
int o_nocaching;
+ int o_delete_glue_parent;
#ifdef LDAP_SLAPI
void *o_pb; /* NS-SLAPI plugin */
typedef struct slap_conn {
int c_struct_state; /* structure management state */
int c_conn_state; /* connection state */
+ int c_conn_idx; /* slot in connections array */
ldap_pvt_thread_mutex_t c_mutex; /* protect the connection */
Sockbuf *c_sb; /* ber connection stuff */
SlapReply *rs,
LDAPControl *ctrl ));
-#define SLMALLOC_SLAB_SIZE 1048576
+#define SLMALLOC_SLAB_SIZE (1024*1024)
LDAP_END_DECL