~james-page/ubuntu/maverick/openldap/fix-666028

« back to all changes in this revision

Viewing changes to servers/slapd/slap.h

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2010-02-18 00:58:13 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20100218005813-8ubmna7xsfo1f098
Tags: upstream-2.4.21
ImportĀ upstreamĀ versionĀ 2.4.21

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* slap.h - stand alone ldap server include file */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/slap.h,v 1.764.2.54 2009/08/25 22:44:25 quanah Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/slap.h,v 1.764.2.59 2009/12/12 06:18:53 hyc Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
5
 * Copyright 1998-2009 The OpenLDAP Foundation.
1527
1527
        struct AccessControl    *acl_next;
1528
1528
} AccessControl;
1529
1529
 
1530
 
typedef enum {
1531
 
        ACL_STATE_NOT_RECORDED                  = 0x0,
1532
 
        ACL_STATE_RECORDED_VD                   = 0x1,
1533
 
        ACL_STATE_RECORDED_NV                   = 0x2,
1534
 
        ACL_STATE_RECORDED                      = ( ACL_STATE_RECORDED_VD | ACL_STATE_RECORDED_NV )
1535
 
} slap_acl_state_t;
1536
 
 
1537
1530
typedef struct AccessControlState {
1538
1531
        /* Access state */
1539
 
        AccessControl *as_vi_acl;
1540
 
        AccessControl *as_vd_acl;
1541
 
        AttributeDescription *as_vd_ad;
1542
 
 
1543
 
 
1544
 
        slap_acl_state_t as_recorded;
 
1532
 
 
1533
        /* The stored state is valid when requesting as_access access
 
1534
         * to the as_desc attributes.    */
 
1535
        AttributeDescription *as_desc;
 
1536
        slap_access_t   as_access;
 
1537
 
 
1538
        /* Value dependent acl where processing can restart */
 
1539
        AccessControl  *as_vd_acl;
1545
1540
        int as_vd_acl_count;
 
1541
        slap_mask_t             as_vd_mask;
 
1542
 
 
1543
        /* The cached result after evaluating a value independent attr.
 
1544
         * Only valid when != -1 and as_vd_acl == NULL */
1546
1545
        int as_result;
 
1546
 
 
1547
        /* True if started to process frontend ACLs */
1547
1548
        int as_fe_done;
1548
1549
} AccessControlState;
1549
 
#define ACL_STATE_INIT { NULL, NULL, NULL, \
1550
 
        ACL_STATE_NOT_RECORDED, 0, 0, 0 }
 
1550
#define ACL_STATE_INIT { NULL, ACL_NONE, NULL, 0, ACL_PRIV_NONE, -1, 0 }
1551
1551
 
1552
1552
typedef struct AclRegexMatches {        
1553
1553
        int dn_count;
1630
1630
        void *aux;
1631
1631
} slap_cf_aux_table;
1632
1632
 
 
1633
typedef int 
 
1634
slap_cf_aux_table_parse_x LDAP_P((
 
1635
        struct berval *val,
 
1636
        void *bc,
 
1637
        slap_cf_aux_table *tab0,
 
1638
        const char *tabmsg,
 
1639
        int unparse ));
 
1640
 
1633
1641
#define SLAP_LIMIT_TIME 1
1634
1642
#define SLAP_LIMIT_SIZE 2
1635
1643
 
1703
1711
 
1704
1712
#define SLAP_SYNC_RID_MAX       999
1705
1713
#define SLAP_SYNC_SID_MAX       4095    /* based on liblutil/csn.c field width */
 
1714
 
 
1715
/* fake conn connid constructed as rid; real connids start
 
1716
 * at SLAPD_SYNC_CONN_OFFSET */
 
1717
#define SLAPD_SYNC_SYNCCONN_OFFSET (SLAP_SYNC_RID_MAX + 1)
 
1718
#define SLAPD_SYNC_IS_SYNCCONN(connid) ((connid) < SLAPD_SYNC_SYNCCONN_OFFSET)
 
1719
#define SLAPD_SYNC_RID2SYNCCONN(rid) (rid)
 
1720
 
1706
1721
#define SLAP_SYNCUUID_SET_SIZE 256
1707
1722
 
1708
1723
struct sync_cookie {
1804
1819
#define SLAP_DBFLAG_SHADOW_MASK         (SLAP_DBFLAG_SHADOW|SLAP_DBFLAG_SINGLE_SHADOW|SLAP_DBFLAG_SYNC_SHADOW|SLAP_DBFLAG_SLURP_SHADOW)
1805
1820
#define SLAP_DBFLAG_CLEAN               0x10000U /* was cleanly shutdown */
1806
1821
#define SLAP_DBFLAG_ACL_ADD             0x20000U /* check attr ACLs on adds */
 
1822
#define SLAP_DBFLAG_SYNC_SUBENTRY       0x40000U /* use subentry for context */
1807
1823
        slap_mask_t     be_flags;
1808
1824
#define SLAP_DBFLAGS(be)                        ((be)->be_flags)
1809
1825
#define SLAP_NOLASTMOD(be)                      (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD)
1830
1846
#define SLAP_MULTIMASTER(be)                    (!SLAP_SINGLE_SHADOW(be))
1831
1847
#define SLAP_DBCLEAN(be)                        (SLAP_DBFLAGS(be) & SLAP_DBFLAG_CLEAN)
1832
1848
#define SLAP_DBACL_ADD(be)                      (SLAP_DBFLAGS(be) & SLAP_DBFLAG_ACL_ADD)
 
1849
#define SLAP_SYNC_SUBENTRY(be)                  (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SYNC_SUBENTRY)
1833
1850
 
1834
1851
        slap_mask_t     be_restrictops;         /* restriction operations */
1835
1852
#define SLAP_RESTRICT_OP_ADD            0x0001U
2760
2777
/*
2761
2778
 * represents a connection from an ldap client
2762
2779
 */
 
2780
/* structure state (protected by connections_mutex) */
 
2781
enum sc_struct_state {
 
2782
        SLAP_C_UNINITIALIZED = 0,       /* MUST BE ZERO (0) */
 
2783
        SLAP_C_UNUSED,
 
2784
        SLAP_C_USED,
 
2785
        SLAP_C_PENDING
 
2786
};
 
2787
 
 
2788
/* connection state (protected by c_mutex ) */
 
2789
enum sc_conn_state {
 
2790
        SLAP_C_INVALID = 0,             /* MUST BE ZERO (0) */
 
2791
        SLAP_C_INACTIVE,                /* zero threads */
 
2792
        SLAP_C_CLOSING,                 /* closing */
 
2793
        SLAP_C_ACTIVE,                  /* one or more threads */
 
2794
        SLAP_C_BINDING,                 /* binding */
 
2795
        SLAP_C_CLIENT                   /* outbound client conn */
 
2796
};
2763
2797
struct Connection {
2764
 
        int                     c_struct_state; /* structure management state */
2765
 
        int                     c_conn_state;   /* connection state */
 
2798
        enum sc_struct_state    c_struct_state; /* structure management state */
 
2799
        enum sc_conn_state      c_conn_state;   /* connection state */
2766
2800
        int                     c_conn_idx;             /* slot in connections array */
2767
2801
        ber_socket_t    c_sd;
2768
2802
        const char      *c_close_reason; /* why connection is closing */