]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slap.h
Import nextid cleanup from devel.
[openldap] / servers / slapd / slap.h
index 4a311bac64452da45bcd4dd3ecac620e29c11474..9a883c0b682c8f567f6ee41fab016784ca4c974d 100644 (file)
 
 #define MAXREMATCHES 10
 
+#define DNSEPARATOR(c) ((c) == ',' || (c) == ';')
+#define SEPARATOR(c)   ((c) == ',' || (c) == ';' || (c) == '+')
+#define SPACE(c)       ((c) == ' ' || (c) == '\n')
+#define NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
+
 LDAP_BEGIN_DECL
 
-struct op;
-struct conn;
+struct slap_op;
+struct slap_conn;
 
 /*
  * represents an attribute value assertion (i.e., attr=value)
@@ -120,6 +125,7 @@ typedef unsigned long       ID;
  */
 typedef struct entry {
        char            *e_dn;          /* DN of this entry               */
+       char            *e_ndn;         /* normalized DN of this entry    */
        Attribute       *e_attrs;       /* list of attributes + values    */
 
        ID              e_id;           /* id of this entry - this should */
@@ -195,8 +201,9 @@ typedef struct backend Backend;
 struct backend {
        char    **be_suffix;    /* the DN suffixes of data in this backend */
         char    **be_suffixAlias;       /* the DN suffix aliases of data in this backend */
-       char    *be_rootdn;     /* the magic "root" dn for this db         */
-       char    *be_rootpw;     /* the magic "root" password for this db   */
+       char    *be_root_dn;    /* the magic "root" dn for this db      */
+       char    *be_root_ndn;   /* the magic "root" normalized dn for this db   */
+       char    *be_root_pw;    /* the magic "root" password for this db        */
        int     be_readonly;    /* 1 => db is in "read only" mode          */
         int     be_maxDerefDepth;       /* limit for depth of an alias deref  */
        int     be_sizelimit;   /* size limit for this backend             */
@@ -205,24 +212,43 @@ struct backend {
        int     be_dfltaccess;  /* access given if no acl matches          */
        char    **be_replica;   /* replicas of this backend (in master)    */
        char    *be_replogfile; /* replication log file (in master)        */
-       char    *be_updatedn;   /* allowed to make changes (in replicas)   */
+       char    *be_update_ndn; /* allowed to make changes (in replicas)   */
        int     be_lastmod;     /* keep track of lastmodified{by,time}     */
        char    *be_type;       /* type of database                        */
 
        void    *be_private;    /* anything the backend needs              */
 
        /* backend routines */
-       int     (*be_bind)   LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, int method, struct berval *cred ));
-       void    (*be_unbind) LDAP_P((Backend *be, struct conn *c, struct op *o ));
-       int     (*be_search) LDAP_P((Backend *be, struct conn *c, struct op *o, char *base, int scope, int deref, int slimit, int tlimit, Filter *f, char *filterstr, char **attrs, int attrsonly));
-       int     (*be_compare)LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, Ava *ava));
-       int     (*be_modify) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, LDAPMod *m));
-       int     (*be_modrdn) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn, char *newrdn, int deleteoldrdn ));
-       int     (*be_add)    LDAP_P((Backend *be, struct conn *c, struct op *o, Entry *e));
-       int     (*be_delete) LDAP_P((Backend *be, struct conn *c, struct op *o, char *dn));
+       int     (*be_bind)   LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               char *dn, int method, struct berval *cred, char** edn ));
+       void    (*be_unbind) LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o ));
+       int     (*be_search) LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               char *base, int scope, int deref, int slimit, int tlimit,
+               Filter *f, char *filterstr, char **attrs, int attrsonly));
+       int     (*be_compare)LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               char *dn, Ava *ava));
+       int     (*be_modify) LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               char *dn, LDAPMod *m));
+       int     (*be_modrdn) LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               char *dn, char *newrdn, int deleteoldrdn ));
+       int     (*be_add)    LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               Entry *e));
+       int     (*be_delete) LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               char *dn));
        /* Bug: be_abandon in unused! */
-       void    (*be_abandon)LDAP_P((Backend *be, struct conn *c, struct op *o, int msgid));
-       void    (*be_config) LDAP_P((Backend *be, char *fname, int lineno, int argc, char **argv ));
+       void    (*be_abandon)LDAP_P((Backend *be,
+               struct slap_conn *c, struct slap_op *o,
+               int msgid));
+       void    (*be_config) LDAP_P((Backend *be,
+               char *fname, int lineno, int argc, char **argv ));
        void    (*be_init)   LDAP_P((Backend *be));
        void    (*be_close)  LDAP_P((Backend *be));
 
@@ -237,14 +263,13 @@ struct backend {
  * represents an operation pending from an ldap client
  */
 
-typedef struct op {
+typedef struct slap_op {
        BerElement      *o_ber;         /* ber of the request             */
        long            o_msgid;        /* msgid of the request           */
        unsigned long   o_tag;          /* tag of the request             */
        time_t          o_time;         /* time op was initiated          */
        char            *o_dn;          /* dn bound when op was initiated */
-        char            *o_suffix;      /* suffix if aliased              */
-        char            *o_suffixAliased;       /* pending suffix translation     */
+       char            *o_ndn;         /* normalized dn bound when op was initiated */
        int             o_authtype;     /* auth method used to bind dn    */
                                        /* values taken from ldap.h       */
                                        /* LDAP_AUTH_*                    */
@@ -255,7 +280,7 @@ typedef struct op {
        struct sockaddr o_clientaddr;   /* client address if via CLDAP    */
        char            o_searchbase;   /* search base if via CLDAP       */
 #endif
-       struct op       *o_next;        /* next operation pending         */
+       struct slap_op  *o_next;        /* next operation pending         */
        pthread_t       o_tid;          /* thread handling this op        */
        int             o_abandon;      /* signals op has been abandoned  */
        pthread_mutex_t o_abandonmutex; /* signals op has been abandoned  */
@@ -267,9 +292,10 @@ typedef struct op {
  * represents a connection from an ldap client
  */
 
-typedef struct conn {
+typedef struct slap_conn {
        Sockbuf         c_sb;           /* ber connection stuff           */
-       char            *c_dn;          /* current DN bound to this conn  */
+       char            *c_cdn;         /* DN provided by the client */
+       char            *c_dn;          /* DN bound to this conn  */
        pthread_mutex_t c_dnmutex;      /* mutex for c_dn field           */
        int             c_authtype;     /* auth method used to bind c_dn  */
 #ifdef LDAP_COMPAT