]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slap.h
ITS#4088 force cursors to use same locker
[openldap] / servers / slapd / slap.h
index 5fed372fd32afbd93d6c84847110b76be269b6e4..c4b35ad52564bf24aa7348b380096af0d8227c04 100644 (file)
@@ -60,6 +60,12 @@ LDAP_BEGIN_DECL
 
 
 #ifdef LDAP_DEVEL
+#define SLAP_LIGHTWEIGHT_DISPATCHER /* experimental slapd architecture */
+#define SLAP_MULTI_CONN_ARRAY
+#ifdef LDAP_PVT_THREAD_POOL_SEM_LOAD_CONTROL
+#define SLAP_SEM_LOAD_CONTROL
+#endif /* LDAP_PVT_THREAD_POOL_SEM_LOAD_CONTROL */
+
 #define SLAP_ACL_HONOR_DISCLOSE        /* partially implemented */
 #define SLAP_ACL_HONOR_MANAGE  /* not yet implemented */
 #define SLAP_DYNACL
@@ -743,6 +749,10 @@ typedef struct slap_object_class {
        LDAP_STAILQ_ENTRY(slap_object_class) soc_next;
 } ObjectClass;
 
+#define        SLAP_OCF_SET_FLAGS      0x1
+#define        SLAP_OCF_CHECK_SUP      0x2
+#define        SLAP_OCF_MASK           (SLAP_OCF_SET_FLAGS|SLAP_OCF_CHECK_SUP)
+
 #define        SLAP_OC_ALIAS           0x0001
 #define        SLAP_OC_REFERRAL        0x0002
 #define        SLAP_OC_SUBENTRY        0x0004
@@ -799,6 +809,13 @@ typedef struct slap_attr_desc {
 #define SLAP_DESC_TAG_RANGE            0x80U
 } AttributeDescription;
 
+/* flags to slap_*2undef_ad to register undefined (0, the default)
+ * or proxied (SLAP_AD_PROXIED) AttributeDescriptions; the additional
+ * SLAP_AD_NOINSERT is to lookup without insert */
+#define SLAP_AD_UNDEF                  0x00U
+#define SLAP_AD_PROXIED                        0x01U
+#define        SLAP_AD_NOINSERT                0x02U
+
 typedef struct slap_attr_name {
        struct berval an_name;
        AttributeDescription *an_desc;
@@ -890,9 +907,6 @@ struct slap_internal_schema {
        AttributeDescription *si_ad_children;
        AttributeDescription *si_ad_saslAuthzTo;
        AttributeDescription *si_ad_saslAuthzFrom;
-#ifdef SLAPD_ACI_ENABLED
-       AttributeDescription *si_ad_aci;
-#endif /* SLAPD_ACI_ENABLED */
 
        /* dynamic entries */
        AttributeDescription *si_ad_entryTtl;
@@ -903,6 +917,8 @@ struct slap_internal_schema {
        AttributeDescription *si_ad_name;
        AttributeDescription *si_ad_cn;
        AttributeDescription *si_ad_uid;
+       AttributeDescription *si_ad_uidNumber;
+       AttributeDescription *si_ad_gidNumber;
        AttributeDescription *si_ad_userPassword;
        AttributeDescription *si_ad_labeledURI;
 #ifdef SLAPD_AUTHPASSWD
@@ -918,6 +934,9 @@ struct slap_internal_schema {
        /* Undefined Attribute Type */
        AttributeType   *si_at_undefined;
 
+       /* "Proxied" Attribute Type */
+       AttributeType   *si_at_proxied;
+
        /* Matching Rules */
        MatchingRule    *si_mr_distinguishedNameMatch;
        MatchingRule    *si_mr_dnSubtreeMatch;
@@ -1158,6 +1177,7 @@ typedef struct slap_mod {
  * running as non-root user, for user modifiable attributes.
  */
 #define        SLAP_MOD_INTERNAL       0x01
+#define        SLAP_MOD_MANAGING       0x02
 
        AttributeDescription *sm_desc;
        struct berval sm_type;
@@ -1173,7 +1193,6 @@ typedef struct slap_mod_list {
 #define        sml_type        sml_mod.sm_type
 #define sml_values     sml_mod.sm_values
 #define sml_nvalues    sml_mod.sm_nvalues
-       char sml_managing;
        struct slap_mod_list *sml_next;
 } Modifications;
 
@@ -1258,9 +1277,10 @@ struct slap_op;
 /*
  * "dynamic" ACL infrastructure (for ACIs and more)
  */
-typedef int (slap_dynacl_parse)( const char *fname, int lineno, slap_style_t, const char *, void **privp );
-typedef int (slap_dynacl_unparse)( void *priv, struct berval *bv );
-typedef int (slap_dynacl_mask)(
+typedef int (slap_dynacl_parse) LDAP_P(( const char *fname, int lineno,
+       const char *opts, slap_style_t, const char *, void **privp ));
+typedef int (slap_dynacl_unparse) LDAP_P(( void *priv, struct berval *bv ));
+typedef int (slap_dynacl_mask) LDAP_P((
                void                    *priv,
                struct slap_op          *op,
                Entry                   *e,
@@ -1269,8 +1289,8 @@ typedef int (slap_dynacl_mask)(
                int                     nmatch,
                regmatch_t              *matches,
                slap_access_t           *grant,
-               slap_access_t           *deny );
-typedef int (slap_dynacl_destroy)( void *priv );
+               slap_access_t           *deny ));
+typedef int (slap_dynacl_destroy) LDAP_P(( void *priv ));
 
 typedef struct slap_dynacl_t {
        char                    *da_name;
@@ -1934,8 +1954,7 @@ typedef struct req_extended_s {
 } req_extended_s;
 
 typedef struct req_pwdexop_s {
-       struct berval rs_reqoid;
-       int rs_flags;
+       struct req_extended_s rs_extended;
        struct berval rs_old;
        struct berval rs_new;
        Modifications *rs_mods;
@@ -2260,6 +2279,7 @@ typedef struct slap_overinst {
 typedef struct slap_overinfo {
        BackendInfo oi_bi;
        BackendInfo *oi_orig;
+       BackendDB       *oi_origdb;
        struct slap_overinst *oi_list;
 } slap_overinfo;
 
@@ -2535,13 +2555,18 @@ typedef struct slap_op {
        BerElement      *o_res_ber;     /* ber of the CLDAP reply or readback control */
        slap_callback *o_callback;      /* callback pointers */
        LDAPControl     **o_ctrls;       /* controls */
+       struct berval o_csn;
 
        void    *o_private;     /* anything the backend needs */
 
        LDAP_STAILQ_ENTRY(slap_op)      o_next; /* next operation in list         */
 
 } Operation;
-#define        OPERATION_BUFFER_SIZE   (sizeof(Operation)+sizeof(Opheader)+SLAP_MAX_CIDS*sizeof(void *))
+#define        OPERATION_BUFFER_SIZE   ( sizeof(Operation) + sizeof(Opheader) + \
+       SLAP_MAX_CIDS*sizeof(void *) )
+
+typedef LBER_ALIGNED_BUFFER(operation_buffer_u,OPERATION_BUFFER_SIZE)
+       OperationBuffer;
 
 #define send_ldap_error( op, rs, err, text ) do { \
                (rs)->sr_err = err; (rs)->sr_text = text; \
@@ -2607,6 +2632,14 @@ typedef struct slap_conn {
 
        /* authorization backend */
        Backend *c_authz_backend;
+       void    *c_authz_cookie;
+#define SLAP_IS_AUTHZ_BACKEND( op )    \
+       ( (op)->o_bd != NULL \
+               && (op)->o_bd->be_private != NULL \
+               && (op)->o_conn != NULL \
+               && (op)->o_conn->c_authz_backend != NULL \
+               && ( (op)->o_bd->be_private == (op)->o_conn->c_authz_backend->be_private \
+                       || (op)->o_bd->be_private == (op)->o_conn->c_authz_cookie ) )
 
        AuthorizationInformation c_authz;
 
@@ -2709,13 +2742,15 @@ struct slap_listener {
 #ifdef LDAP_CONNECTIONLESS
        int     sl_is_udp;              /* UDP listener is also data port */
 #endif
-       int     sl_is_mute;     /* Listening is temporarily disabled */
+       int     sl_mute;        /* Listener is temporarily disabled due to emfile */
+#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
+       int     sl_busy;        /* Listener is busy (accept thread activated */
+#endif
        ber_socket_t sl_sd;
        Sockaddr sl_sa;
 #define sl_addr        sl_sa.sa_in_addr
 };
 
-#ifdef SLAPD_MONITOR
 /*
  * Operation indices
  */
@@ -2732,7 +2767,6 @@ enum {
        SLAP_OP_EXTENDED,
        SLAP_OP_LAST
 };
-#endif /* SLAPD_MONITOR */
 
 typedef struct slap_counters_t {
        ldap_pvt_thread_mutex_t sc_sent_mutex;