]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slap.h
uses URL extensions to set socket permissions other than default
[openldap] / servers / slapd / slap.h
index 293aa269c68c211be33c67ba1935f74e42c0a937..b821ecc38e79db106ee6200232e45f4d8a59637b 100644 (file)
@@ -73,6 +73,9 @@ LDAP_BEGIN_DECL
 
 #define SLAP_MAX_WORKER_THREADS                (32)
 
+#define SLAP_SB_MAX_INCOMING_DEFAULT ((1<<18) - 1)
+#define SLAP_SB_MAX_INCOMING_AUTH ((1<<24) - 1)
+
 #define SLAP_TEXT_BUFLEN (256)
 
 /* psuedo error code indicating abandoned operation */
@@ -172,7 +175,7 @@ typedef struct slap_ssf_set {
 
 #define SLAP_INDEX_DEFAULT        SLAP_INDEX_EQUALITY
 
-#define IS_SLAP_INDEX(mask, type)      (((mask) & (type)) == (type) )
+#define IS_SLAP_INDEX(mask, type)      (((mask) & (type)) == (type))
 
 #define SLAP_INDEX_SUBSTR_TYPE    0x0F00UL
 
@@ -468,8 +471,8 @@ typedef struct slap_object_class {
        struct slap_object_class        **soc_sups;
        AttributeType                           **soc_required;
        AttributeType                           **soc_allowed;
-       ObjectClassSchemaCheckFN        *sco_check;
-       slap_mask_t                                     sco_flags;
+       ObjectClassSchemaCheckFN        *soc_check;
+       slap_mask_t                                     soc_flags;
 #define soc_oid                                soc_oclass.oc_oid
 #define soc_names                      soc_oclass.oc_names
 #define soc_desc                       soc_oclass.oc_desc
@@ -483,6 +486,14 @@ typedef struct slap_object_class {
        struct slap_object_class        *soc_next;
 } ObjectClass;
 
+#define        SLAP_OC_ALIAS           0x01
+#define        SLAP_OC_REFERRAL        0x02
+#define        SLAP_OC_SUBENTRY        0x04
+#define        SLAP_OC_DYNAMICOBJECT   0x08
+#define        SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY     0x10
+#define        SLAP_OC__MASK           0x1F
+#define        SLAP_OC__END            0x20
+
 #ifdef LDAP_EXTENDED_SCHEMA
 /*
  * DIT content rule
@@ -514,8 +525,9 @@ typedef struct slap_attr_desc {
        struct berval ad_cname;         /* canonical name, must be specified */
        struct berval ad_lang;          /* empty if no language tags */
        unsigned ad_flags;
-#define SLAP_DESC_NONE         0x0U
-#define SLAP_DESC_BINARY       0x1U
+#define SLAP_DESC_NONE                 0x00U
+#define SLAP_DESC_BINARY               0x01U
+#define SLAP_DESC_LANG_RANGE   0x80U
 } AttributeDescription;
 
 typedef struct slap_attr_name {
@@ -524,8 +536,11 @@ typedef struct slap_attr_name {
        ObjectClass *an_oc;
 } AttributeName;
 
-#define slap_ad_is_lang(ad)            ( (ad)->ad_lang.bv_len != 0 )
-#define slap_ad_is_binary(ad)  ( (int)((ad)->ad_flags & SLAP_DESC_BINARY) ? 1 : 0 )
+#define slap_ad_is_lang(ad)                    ( (ad)->ad_lang.bv_len != 0 )
+#define slap_ad_is_binary(ad)          \
+       ( ((ad)->ad_flags & SLAP_DESC_LANG_RANGE) ? 1 : 0 )
+#define slap_ad_is_lang_range(ad)      \
+       ( ((ad)->ad_flags & SLAP_DESC_BINARY) ? 1 : 0 )
 
 /*
  * pointers to schema elements used internally
@@ -540,7 +555,7 @@ struct slap_internal_schema {
        ObjectClass *si_oc_subentry;
        ObjectClass *si_oc_subschema;
        ObjectClass *si_oc_monitor;
-       ObjectClass *si_oc_collectiveAttributes;
+       ObjectClass *si_oc_collectiveAttributeSubentry;
        ObjectClass *si_oc_dynamicObject;
 
        /* objectClass attribute descriptions */
@@ -554,7 +569,7 @@ struct slap_internal_schema {
        AttributeDescription *si_ad_modifyTimestamp;
        AttributeDescription *si_ad_hasSubordinates;
        AttributeDescription *si_ad_subschemaSubentry;
-       AttributeDescription *si_ad_collectiveSubentry;
+       AttributeDescription *si_ad_collectiveSubentries;
        AttributeDescription *si_ad_collectiveExclusions;
        AttributeDescription *si_ad_entryUUID;
        AttributeDescription *si_ad_entryCSN;
@@ -743,6 +758,10 @@ typedef struct slap_entry {
 
        Attribute       *e_attrs;       /* list of attributes + values */
 
+       slap_mask_t     e_ocflags;
+
+       struct berval   e_bv;           /* For entry_encode/entry_decode */
+
        /* for use by the backend for any purpose */
        void*   e_private;
 } Entry;
@@ -809,7 +828,7 @@ typedef enum slap_style_e {
 
 typedef struct slap_authz_info {
        ber_tag_t       sai_method;             /* LDAP_AUTH_* from <ldap.h> */
-       char *          sai_mech;               /* SASL Mechanism */
+       struct berval   sai_mech;               /* SASL Mechanism */
        struct berval   sai_dn;                 /* DN for reporting purposes */
        struct berval   sai_ndn;                /* Normalized DN */
 
@@ -891,14 +910,14 @@ typedef struct slap_access {
        int                     a_dn_self;
 
        slap_style_t a_peername_style;
-       char            *a_peername_pat;
+       struct berval   a_peername_pat;
        slap_style_t a_sockname_style;
-       char            *a_sockname_pat;
+       struct berval   a_sockname_pat;
 
        slap_style_t a_domain_style;
-       char            *a_domain_pat;
+       struct berval   a_domain_pat;
        slap_style_t a_sockurl_style;
-       char            *a_sockurl_pat;
+       struct berval   a_sockurl_pat;
        slap_style_t a_set_style;
        struct berval   a_set_pat;
 
@@ -1390,6 +1409,7 @@ typedef struct slap_op {
        char o_managedsait;
        char o_subentries;
        char o_subentries_visibility;
+       char o_noop;
 
        int             o_abandon;      /* abandon flag */
        ldap_pvt_thread_mutex_t o_abandonmutex; /* protects o_abandon  */
@@ -1440,14 +1460,14 @@ typedef struct slap_conn {
        time_t          c_activitytime; /* when the connection was last used */
        unsigned long           c_connid;       /* id of this connection for stats*/
 
-       char            *c_listener_url;        /* listener URL */
-       char            *c_peer_domain; /* DNS name of client */
-       char            *c_peer_name;   /* peer name (trans=addr:port) */
-       char            *c_sock_name;   /* sock name (trans=addr:port) */
+       struct berval   c_listener_url; /* listener URL */
+       struct berval   c_peer_domain;  /* DNS name of client */
+       struct berval   c_peer_name;    /* peer name (trans=addr:port) */
+       struct berval   c_sock_name;    /* sock name (trans=addr:port) */
 
        /* only can be changed by binding thread */
        int             c_sasl_bind_in_progress;        /* multi-op bind in progress */
-       char    *c_sasl_bind_mech;                      /* mech in progress */
+       struct berval   c_sasl_bind_mech;                       /* mech in progress */
        struct berval   c_cdn;
 
        /* authentication backend */
@@ -1517,11 +1537,6 @@ typedef struct sasl_regexp {
   int offset[SASLREGEX_REPLACE+2];        /* offsets of $1,$2... in *replace */
 } SaslRegexp_t;
 
-/* Flags for telling slap_sasl_getdn() what type of identity is being passed */
-#define FLAG_GETDN_FINAL   1
-#define FLAG_GETDN_AUTHCID 2
-#define FLAG_GETDN_AUTHZID 4
-
 /*
  * listener; need to access it from monitor backend
  */