]> git.sur5r.net Git - openldap/commitdiff
Suck in patches using Quanah's diffs
authorKurt Zeilenga <kurt@openldap.org>
Tue, 9 May 2006 19:29:11 +0000 (19:29 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 9 May 2006 19:29:11 +0000 (19:29 +0000)
+       Fixed slapo-syncprov MODs cause DELs (ITS#4423)
+       Fixed slapd slap_send_ldap_result bug (ITS#4499)
+       Fixed slapd-ldif deadlock (ITS#4500)
+       Fixed liblutil strtoul(3) usage (ITS#4503)
+       Updated ldapsearch(1) BASE output (ITS#4504)
+       Fixed slapd cn=config (ITS#4512)
+       Fixed slapd thread pool init issue (ITS#4513)
+       Fixed slapd cn=config olcLimits (ITS#4515)
+       Fixed slapd runqueue use of freed memory (ITS#4517)

13 files changed:
CHANGES
include/ldap_rq.h
libraries/libldap_r/rq.c
libraries/liblutil/utils.c
servers/slapd/back-ldif/ldif.c
servers/slapd/bconfig.c
servers/slapd/daemon.c
servers/slapd/init.c
servers/slapd/ldapsync.c
servers/slapd/overlays/retcode.c
servers/slapd/overlays/syncprov.c
servers/slapd/saslauthz.c
servers/slapd/syncrepl.c

diff --git a/CHANGES b/CHANGES
index 3a987ec8f9f7038386e4ff1ca0f5029649ae18a1..4c1daca36e07f9f08f928d1950f3edaed3aa6343 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,15 @@ OpenLDAP 2.3 Change Log
 
 OpenLDAP 2.3.22 Engineering
        Fixed slapd-ldap fd cleanup (ITS#4474)
+       Fixed slapo-syncprov MODs cause DELs (ITS#4423)
+       Fixed slapd slap_send_ldap_result bug (ITS#4499)
+       Fixed slapd-ldif deadlock (ITS#4500)
+       Fixed liblutil strtoul(3) usage (ITS#4503)
+       Updated ldapsearch(1) BASE output (ITS#4504)
+       Fixed slapd cn=config (ITS#4512)
+       Fixed slapd thread pool init issue (ITS#4513)
+       Fixed slapd cn=config olcLimits (ITS#4515)
+       Fixed slapd runqueue use of freed memory (ITS#4517)
 
 OpenLDAP 2.3.21 Release
        Fixed libldap referral chasing issue (ITS#4448)
index 3e124778c9d4380129b1da9d2691e7d49f6988b5..1e3aea16f161a9dbd23eb52b8a9720c3e3854fc9 100644 (file)
@@ -63,7 +63,7 @@ ldap_pvt_runqueue_remove(
 LDAP_F( struct re_s* )
 ldap_pvt_runqueue_next_sched(
        struct runqueue_s* rq,
-       struct timeval** next_run
+       struct timeval* next_run
 );
 
 LDAP_F( void )
index 2ee0db61007b0d632bc302967a7b1f4b519ec5e7..e692c628ed1f2e52cd04b120f0dc556157a831c6 100644 (file)
@@ -99,20 +99,16 @@ ldap_pvt_runqueue_remove(
 struct re_s*
 ldap_pvt_runqueue_next_sched(
        struct runqueue_s* rq,
-       struct timeval** next_run
+       struct timeval* next_run
 )
 {
        struct re_s* entry;
 
        entry = LDAP_STAILQ_FIRST( &rq->task_list );
-       if ( entry == NULL ) {
-               *next_run = NULL;
-               return NULL;
-       } else if ( entry->next_sched.tv_sec == 0 ) {
-               *next_run = NULL;
+       if ( entry == NULL || entry->next_sched.tv_sec == 0 ) {
                return NULL;
        } else {
-               *next_run = &entry->next_sched;
+               *next_run = entry->next_sched;
                return entry;
        }
 }
index e76395f4e97af4dd93a00edb2904942f8d1e8a00..31849fea04141b836f91a164732310bcb6213c05 100644 (file)
@@ -362,6 +362,11 @@ lutil_atoux( unsigned *v, const char *s, int x )
        assert( s != NULL );
        assert( v != NULL );
 
+       /* strtoul() has an odd interface */
+       if ( s[ 0 ] == '-' ) {
+               return -1;
+       }
+
        u = strtoul( s, &next, x );
        if ( next == s || next[ 0 ] != '\0' ) {
                return -1;
@@ -404,6 +409,11 @@ lutil_atoulx( unsigned long *v, const char *s, int x )
        assert( s != NULL );
        assert( v != NULL );
 
+       /* strtoul() has an odd interface */
+       if ( s[ 0 ] == '-' ) {
+               return -1;
+       }
+
        ul = strtoul( s, &next, x );
        if ( next == s || next[ 0 ] != '\0' ) {
                return -1;
@@ -433,6 +443,11 @@ lutil_parse_time(
                unsigned long   u;
                char            *what;
 
+               /* strtoul() has an odd interface */
+               if ( s[ 0 ] == '-' ) {
+                       return -1;
+               }
+
                u = strtoul( s, &next, 10 );
                if ( next == s ) {
                        return -1;
index 27d8435785b6419a9b80eddeab0d53bb35d75fb3..7e67c4bc1f73aabc861f9c32576f4b4b41fe180f 100644 (file)
@@ -43,7 +43,7 @@ struct ldif_info {
        struct berval li_base_path;
        enumCookie li_tool_cookie;
        ID li_tool_current;
-       ldap_pvt_thread_mutex_t  li_mutex;
+       ldap_pvt_thread_rdwr_t  li_rdwr;
 };
 
 #ifdef _WIN32
@@ -175,7 +175,7 @@ static int spew_entry(Entry * e, struct berval * path) {
                else
                        rs = LDAP_UNWILLING_TO_PERFORM;
                Debug( LDAP_DEBUG_ANY, "could not open \"%s\": %s\n",
-                       path->bv_val, strerror( errno ), 0 );
+                       path->bv_val, STRERROR( errno ), 0 );
        }
        else {
                struct berval rdn;
@@ -300,7 +300,7 @@ static int r_enum_tree(enumCookie *ck, struct berval *path,
        if ( fd < 0 ) {
                Debug( LDAP_DEBUG_ANY,
                        "=> ldif_enum_tree: failed to open %s: %s\n",
-                       path->bv_val, strerror(errno), 0 );
+                       path->bv_val, STRERROR(errno), 0 );
                return LDAP_NO_SUCH_OBJECT;
        }
 
@@ -412,6 +412,8 @@ static int r_enum_tree(enumCookie *ck, struct berval *path,
                                if ( ptr ) {
                                        itmp.bv_len = ptr - itmp.bv_val;
                                        ber_dupbv( &bvl->num, &itmp );
+                                       /* FIXME: handle error? */
+                                       assert( itmp.bv_val[ 0 ] != '-' );
                                        bvl->inum = strtoul( itmp.bv_val, NULL, 0 );
                                        itmp.bv_val[0] = '\0';
                                        bvl->off = itmp.bv_val - bvl->bv.bv_val;
@@ -588,7 +590,7 @@ ldif_back_referrals( Operation *op, SlapReply *rs )
        }
 
        ni = (struct ldif_info *)op->o_bd->be_private;
-       ldap_pvt_thread_mutex_lock( &ni->li_mutex );
+       ldap_pvt_thread_rdwr_rlock( &ni->li_rdwr );
        entry = (Entry *)get_entry( op, &ni->li_base_path );
 
        /* no object is found for them */
@@ -611,7 +613,7 @@ ldif_back_referrals( Operation *op, SlapReply *rs )
                        entry = (Entry *)get_entry( op, &ni->li_base_path );
                }
 
-               ldap_pvt_thread_mutex_unlock( &ni->li_mutex );
+               ldap_pvt_thread_rdwr_runlock( &ni->li_rdwr );
 
                op->o_req_dn = odn;
                op->o_req_ndn = ondn;
@@ -661,7 +663,7 @@ ldif_back_referrals( Operation *op, SlapReply *rs )
                return rc;
        }
 
-       ldap_pvt_thread_mutex_unlock( &ni->li_mutex );
+       ldap_pvt_thread_rdwr_runlock( &ni->li_rdwr );
 
        if ( is_entry_referral( entry ) ) {
                /* entry is a referral */
@@ -704,7 +706,7 @@ ldif_back_bind( Operation *op, SlapReply *rs )
        Entry * entry = NULL;
 
        ni = (struct ldif_info *) op->o_bd->be_private;
-       ldap_pvt_thread_mutex_lock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_rlock(&ni->li_rdwr);
        entry = (Entry *) get_entry(op, &ni->li_base_path);
 
        /* no object is found for them */
@@ -737,7 +739,7 @@ ldif_back_bind( Operation *op, SlapReply *rs )
        goto return_result;
 
  return_result:
-       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_runlock(&ni->li_rdwr);
        if(return_val != 0)
                send_ldap_result( op, rs );
        if(entry != NULL)
@@ -752,9 +754,9 @@ static int ldif_back_search(Operation *op, SlapReply *rs)
 
        ck.op = op;
        ck.rs = rs;
-       ldap_pvt_thread_mutex_lock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_rlock(&ni->li_rdwr);
        rs->sr_err = enum_tree( &ck );
-       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_runlock(&ni->li_rdwr);
        send_ldap_result(op, rs);
 
        return rs->sr_err;
@@ -776,7 +778,7 @@ static int ldif_back_add(Operation *op, SlapReply *rs) {
                &rs->sr_text, textbuf, sizeof( textbuf ) );
        if ( rs->sr_err != LDAP_SUCCESS ) goto send_res;
                                
-       ldap_pvt_thread_mutex_lock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_wlock(&ni->li_rdwr);
 
        dn2path(&dn, &op->o_bd->be_nsuffix[0], &ni->li_base_path, &leaf_path);
 
@@ -800,7 +802,7 @@ static int ldif_back_add(Operation *op, SlapReply *rs) {
                                        rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                                        rs->sr_text = "Could not create parent folder";
                                        Debug( LDAP_DEBUG_ANY, "could not create folder \"%s\": %s\n",
-                                               base.bv_val, strerror( errno ), 0 );
+                                               base.bv_val, STRERROR( errno ), 0 );
                                }
                        }
                        else
@@ -816,7 +818,7 @@ static int ldif_back_add(Operation *op, SlapReply *rs) {
                        else if ( statres == -1 ) {
                                rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                                Debug( LDAP_DEBUG_ANY, "could not stat file \"%s\": %s\n",
-                                       leaf_path.bv_val, strerror( errno ), 0 );
+                                       leaf_path.bv_val, STRERROR( errno ), 0 );
                        }
                        else /* it already exists */
                                rs->sr_err = LDAP_ALREADY_EXISTS;
@@ -825,11 +827,12 @@ static int ldif_back_add(Operation *op, SlapReply *rs) {
                SLAP_FREE(leaf_path.bv_val);
        }
 
-       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_wunlock(&ni->li_rdwr);
 
 send_res:
        Debug( LDAP_DEBUG_TRACE, 
-                       "ldif_back_add: err: %d text: %s\n", rs->sr_err, rs->sr_text, 0);
+               "ldif_back_add: err: %d text: %s\n", rs->sr_err, rs->sr_text ?
+                       rs->sr_text : "", 0);
        send_ldap_result(op, rs);
        slap_graduate_commit_csn( op );
        return 0;
@@ -844,7 +847,7 @@ static int ldif_back_modify(Operation *op, SlapReply *rs) {
 
        slap_mods_opattrs( op, &op->orm_modlist, 1 );
 
-       ldap_pvt_thread_mutex_lock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_wlock(&ni->li_rdwr);
        dn2path(&op->o_req_ndn, &op->o_bd->be_nsuffix[0], &ni->li_base_path,
                &path);
        entry = (Entry *) get_entry(op, &ni->li_base_path);
@@ -870,7 +873,7 @@ static int ldif_back_modify(Operation *op, SlapReply *rs) {
        if(path.bv_val != NULL)
                SLAP_FREE(path.bv_val);
        rs->sr_text = NULL;
-       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_wunlock(&ni->li_rdwr);
        send_ldap_result(op, rs);
        slap_graduate_commit_csn( op );
        return 0;
@@ -890,7 +893,7 @@ static int ldif_back_delete(Operation *op, SlapReply *rs) {
                slap_get_csn( op, &csn, 1 );
        }
 
-       ldap_pvt_thread_mutex_lock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_wlock(&ni->li_rdwr);
        dn2path(&op->o_req_ndn, &op->o_bd->be_nsuffix[0], &ni->li_base_path, &path);
 
        path.bv_val[path.bv_len - STRLENOF(LDIF)] = '\0';
@@ -912,7 +915,7 @@ static int ldif_back_delete(Operation *op, SlapReply *rs) {
                rs->sr_err = LDAP_SUCCESS;
 
        SLAP_FREE(path.bv_val);
-       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_wunlock(&ni->li_rdwr);
        send_ldap_result(op, rs);
        slap_graduate_commit_csn( op );
        return 0;
@@ -937,6 +940,7 @@ static int move_entry(Entry * entry, struct berval * ndn,
        else { /* do the modrdn */
                exists_res = open(newpath.bv_val, O_RDONLY);
                if(exists_res == -1 && errno == ENOENT) {
+                       ldap_pvt_thread_mutex_lock( &entry2str_mutex );
                        res = spew_entry(entry, &newpath);
                        if(res != -1) {
                                /* if this fails we should log something bad */
@@ -950,6 +954,7 @@ static int move_entry(Entry * entry, struct berval * ndn,
                                        res = LDAP_UNWILLING_TO_PERFORM;
                                unlink(newpath.bv_val); /* in case file was created */
                        }
+                       ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
                }
                else if(exists_res) {
                        int close_res = close(exists_res);
@@ -980,8 +985,7 @@ static int ldif_back_modrdn(Operation *op, SlapReply *rs) {
        Modifications * mods = NULL;
        int res;
 
-       ldap_pvt_thread_mutex_lock(&ni->li_mutex);
-       ldap_pvt_thread_mutex_lock(&entry2str_mutex);
+       ldap_pvt_thread_rdwr_wlock( &ni->li_rdwr );
        entry = (Entry *) get_entry(op, &ni->li_base_path);
 
        /* build the mods to the entry */
@@ -1033,8 +1037,7 @@ static int ldif_back_modrdn(Operation *op, SlapReply *rs) {
        if(entry != NULL)
                entry_free(entry);
        rs->sr_text = "";
-       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
-       ldap_pvt_thread_mutex_unlock(&entry2str_mutex);
+       ldap_pvt_thread_rdwr_wunlock( &ni->li_rdwr );
        send_ldap_result(op, rs);
        slap_graduate_commit_csn( op );
        return 0;
@@ -1052,11 +1055,11 @@ int ldif_back_entry_get(
 {
        struct ldif_info *ni = (struct ldif_info *) op->o_bd->be_private;
 
-       ldap_pvt_thread_mutex_lock( &ni->li_mutex );
+       ldap_pvt_thread_rdwr_rlock( &ni->li_rdwr );
 
        *ent = (Entry *) get_entry( op, &ni->li_base_path );
 
-       ldap_pvt_thread_mutex_unlock( &ni->li_mutex );
+       ldap_pvt_thread_rdwr_runlock( &ni->li_rdwr );
 
        return ( *ent == NULL ? 1 : 0 );
 }
@@ -1177,7 +1180,7 @@ ldif_back_db_init( BackendDB *be )
        ni = ch_calloc( 1, sizeof(struct ldif_info) );
        be->be_private = ni;
        be->be_cf_ocs = ldifocs;
-       ldap_pvt_thread_mutex_init(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_init(&ni->li_rdwr);
        return 0;
 }
 
@@ -1189,7 +1192,7 @@ ldif_back_db_destroy(
        struct ldif_info *ni = be->be_private;
 
        ch_free(ni->li_base_path.bv_val);
-       ldap_pvt_thread_mutex_destroy(&ni->li_mutex);
+       ldap_pvt_thread_rdwr_destroy(&ni->li_rdwr);
        free( be->be_private );
        return 0;
 }
index da805145d2b5474066be024c060bfdf9620ca253..014a79b686b7571cc90f4492b793886cbbc9ccbe 100644 (file)
@@ -332,6 +332,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "limits", "limits", 2, 0, 0, ARG_DB|ARG_MAGIC|CFG_LIMITS,
                &config_generic, "( OLcfgDbAt:0.5 NAME 'olcLimits' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "localSSF", "ssf", 2, 2, 0, ARG_INT,
                &local_ssf, "( OLcfgGlAt:26 NAME 'olcLocalSSF' "
@@ -341,6 +342,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "loglevel", "level", 2, 0, 0, ARG_MAGIC,
                &config_loglevel, "( OLcfgGlAt:28 NAME 'olcLogLevel' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "maxDerefDepth", "depth", 2, 2, 0, ARG_DB|ARG_INT|ARG_MAGIC|CFG_DEPTH,
                &config_generic, "( OLcfgDbAt:0.6 NAME 'olcMaxDerefDepth' "
@@ -352,6 +354,7 @@ static ConfigTable config_back_cf_table[] = {
                ARG_IGNORED, NULL,
 #endif
                "( OLcfgGlAt:30 NAME 'olcModuleLoad' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "modulepath", "path", 2, 2, 0,
 #ifdef SLAPD_MODULES
@@ -369,6 +372,7 @@ static ConfigTable config_back_cf_table[] = {
                        NULL, NULL },
        { "objectidentifier", NULL,     0, 0, 0, ARG_MAGIC|CFG_OID,
                &config_generic, "( OLcfgGlAt:33 NAME 'olcObjectIdentifier' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "overlay", "overlay", 2, 2, 0, ARG_MAGIC,
                &config_overlay, "( OLcfgGlAt:34 NAME 'olcOverlay' "
@@ -378,6 +382,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "password-hash", "hash", 2, 2, 0, ARG_MAGIC,
                &config_passwd_hash, "( OLcfgGlAt:36 NAME 'olcPasswordHash' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pidfile", "file", 2, 2, 0, ARG_STRING,
                &slapd_pid_file, "( OLcfgGlAt:37 NAME 'olcPidFile' "
@@ -389,6 +394,7 @@ static ConfigTable config_back_cf_table[] = {
                ARG_IGNORED, NULL,
 #endif
                "( OLcfgGlAt:38 NAME 'olcPlugin' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pluginlog", "filename", 2, 2, 0,
 #ifdef LDAP_SLAPI
@@ -406,6 +412,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SUP labeledURI SINGLE-VALUE )", NULL, NULL },
        { "replica", "host or uri", 2, 0, 0, ARG_DB|ARG_MAGIC,
                &config_replica, "( OLcfgDbAt:0.7 NAME 'olcReplica' "
+                       "EQUALITY caseIgnoreMatch "
                        "SUP labeledURI X-ORDERED 'VALUES' )", NULL, NULL },
        { "replica-argsfile", NULL, 0, 0, 0, ARG_STRING,
                &replica_argsFile, "( OLcfgGlAt:43 NAME 'olcReplicaArgsFile' "
@@ -421,9 +428,11 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "require", "features", 2, 0, 7, ARG_MAY_DB|ARG_MAGIC,
                &config_requires, "( OLcfgGlAt:47 NAME 'olcRequires' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "restrict", "op_list", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
                &config_restrict, "( OLcfgGlAt:48 NAME 'olcRestrict' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "reverse-lookup", "on|off", 2, 2, 0,
 #ifdef SLAPD_RLOOKUPS
@@ -438,6 +447,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "rootDSE", "file", 2, 2, 0, ARG_MAGIC|CFG_ROOTDSE,
                &config_generic, "( OLcfgGlAt:51 NAME 'olcRootDSE' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "rootpw", "password", 2, 2, 0, ARG_BERVAL|ARG_DB|ARG_MAGIC,
                &config_rootpw, "( OLcfgDbAt:0.9 NAME 'olcRootPW' "
@@ -477,6 +487,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "security", "factors", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
                &config_security, "( OLcfgGlAt:59 NAME 'olcSecurity' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "sizelimit", "limit", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
                &config_sizelimit, "( OLcfgGlAt:60 NAME 'olcSizeLimit' "
@@ -497,9 +508,10 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "subordinate", "[advertise]", 1, 2, 0, ARG_DB|ARG_MAGIC,
                &config_subordinate, "( OLcfgDbAt:0.15 NAME 'olcSubordinate' "
-                       "SYNTAX OMsDirectoryString )", NULL, NULL },
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "suffix",     "suffix", 2, 2, 0, ARG_DB|ARG_DN|ARG_QUOTE|ARG_MAGIC,
                &config_suffix, "( OLcfgDbAt:0.10 NAME 'olcSuffix' "
+                       "EQUALITY distinguishedNameMatch "
                        "SYNTAX OMsDN )", NULL, NULL },
        { "syncrepl", NULL, 0, 0, 0, ARG_DB|ARG_MAGIC,
                &syncrepl_config, "( OLcfgDbAt:0.11 NAME 'olcSyncrepl' "
@@ -597,6 +609,7 @@ static ConfigTable config_back_cf_table[] = {
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "updateref", "url", 2, 2, 0, ARG_DB|ARG_MAGIC,
                &config_updateref, "( OLcfgDbAt:0.13 NAME 'olcUpdateRef' "
+                       "EQUALITY caseIgnoreMatch "
                        "SUP labeledURI )", NULL, NULL },
        { NULL, NULL, 0, 0, 0, ARG_IGNORED,
                NULL, NULL, NULL, NULL }
@@ -1195,7 +1208,16 @@ config_generic(ConfigArgs *c) {
                        break;
 
                case CFG_ACL:
-                       if ( parse_acl(c->be, c->fname, c->lineno, c->argc, c->argv, c->valx) ) {
+                       /* Don't append to the global ACL if we're on a specific DB */
+                       i = c->valx;
+                       if ( c->be != frontendDB && frontendDB->be_acl && c->valx == -1 ) {
+                               AccessControl *a;
+                               i = 0;
+                               for ( a=c->be->be_acl; a && a != frontendDB->be_acl;
+                                       a = a->acl_next )
+                                       i++;
+                       }
+                       if ( parse_acl(c->be, c->fname, c->lineno, c->argc, c->argv, i ) ) {
                                return 1;
                        }
                        break;
@@ -2478,6 +2500,11 @@ config_replica(ConfigArgs *c) {
                                /* dealt with separately; don't let it get to bindconf */
                                ;
 
+                       } else if(!strncasecmp(c->argv[i], "host=", STRLENOF("host="))) {
+                               /* dealt with separately; don't let it get to bindconf */
+                               ;
+
+
                        } else if(!strncasecmp(c->argv[i], "suffix=", STRLENOF( "suffix="))) {
                                switch(add_replica_suffix(c->be, nr, c->argv[i] + STRLENOF("suffix="))) {
                                        case 1:
index b1724ed3a140502547e7dcbdbf4582746a85e33b..f5df4a16b6534f87f1e9bc8f3922e4a5e799b167 100644 (file)
@@ -1703,7 +1703,7 @@ slapd_daemon_task(
                struct timeval          tv;
                struct timeval          *tvp;
 
-               struct timeval          *cat;
+               struct timeval          cat;
                time_t                          tdelta = 1;
                struct re_s*            rtask;
                now = slap_get_time();
@@ -1784,7 +1784,7 @@ slapd_daemon_task(
 
                ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
                rtask = ldap_pvt_runqueue_next_sched( &slapd_rq, &cat );
-               while ( cat && cat->tv_sec && cat->tv_sec <= now ) {
+               while ( rtask && cat.tv_sec && cat.tv_sec <= now ) {
                        if ( ldap_pvt_runqueue_isrunning( &slapd_rq, rtask )) {
                                ldap_pvt_runqueue_resched( &slapd_rq, rtask, 0 );
                        } else {
@@ -1799,8 +1799,8 @@ slapd_daemon_task(
                }
                ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
 
-               if ( cat && cat->tv_sec ) {
-                       time_t diff = difftime( cat->tv_sec, now );
+               if ( rtask && cat.tv_sec ) {
+                       time_t diff = difftime( cat.tv_sec, now );
                        if ( diff == 0 ) diff = tdelta;
                        if ( tvp == NULL || diff < tv.tv_sec ) {
                                tv.tv_sec = diff;
index 053184f797d6d3b9280798ad1819ca83a0c0aa9a..86f839d9338ad458dc2d8eb15bc9097a2039e219 100644 (file)
@@ -125,8 +125,6 @@ slap_init( int mode, const char *name )
 
        switch ( slapMode & SLAP_MODE ) {
        case SLAP_SERVER_MODE:
-               ldap_pvt_thread_pool_init( &connection_pool,
-                               connection_pool_max, 0);
 
                /* FALLTHRU */
        case SLAP_TOOL_MODE:
@@ -137,6 +135,8 @@ slap_init( int mode, const char *name )
 
                slap_name = name;
 
+               ldap_pvt_thread_pool_init( &connection_pool,
+                               connection_pool_max, 0);
                ldap_pvt_thread_mutex_init( &entry2str_mutex );
                ldap_pvt_thread_mutex_init( &replog_mutex );
 
index cc1ed8705468df15f5d7fc9f0cdd8c4ed3095684..9d2e169048da6d208a4c59bcd46280b4e412ede7 100644 (file)
@@ -114,6 +114,10 @@ slap_parse_sync_cookie(
                return -1;
        }
 
+       if ( rid_ptr[ STRLENOF( "rid=" ) ] == '-' ) {
+               return -1;
+       }
+
        cookie->rid = strtoul( &rid_ptr[ STRLENOF( "rid=" ) ], &next, 10 );
        if ( next == &rid_ptr[ STRLENOF( "rid=" ) ] || ( next[ 0 ] != ',' && next[ 0 ] != '\0' ) ) {
                return -1;
index 8b09f733613228d0a4047a771ba4bd4003fe8415..133efb673803a2e0b80cbfb569140b374cd9b33e 100644 (file)
@@ -531,7 +531,7 @@ retcode_entry_response( Operation *op, SlapReply *rs, BackendInfo *bi, Entry *e
 
        /* sleep time */
        a = attr_find( e->e_attrs, ad_errSleepTime );
-       if ( a != NULL ) {
+       if ( a != NULL & a->a_nvals[ 0 ].bv_val[ 0 ] != '-' ) {
                int     sleepTime;
 
                sleepTime = strtoul( a->a_nvals[ 0 ].bv_val, &next, 0 );
index 2278ad34ebd284b1e4cce696d0aea16b80313fd9..b4c42c3f52d7f0c1cda3877e63fd4100b09431e0 100644 (file)
@@ -1346,7 +1346,7 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl,
         * unlock the list mutex.
         */
        for ( se=sl->sl_head; se; se=se->se_next ) {
-               if ( ber_bvcmp( &se->se_csn, oldcsn ) < 0 ) continue;
+               if ( ber_bvcmp( &se->se_csn, oldcsn ) <= 0 ) continue;
                if ( ber_bvcmp( &se->se_csn, ctxcsn ) > 0 ) break;
                if ( se->se_tag == LDAP_REQ_DELETE ) {
                        j = i;
index c309d110fb638b6a0b91537d42bd8113d8c6678d..65207a356acc5763e694ed50f892094da0a18e85 100644 (file)
@@ -1576,24 +1576,25 @@ static int slap_authz_regexp( struct berval *in, struct berval *out,
 }
 
 /* This callback actually does some work...*/
-static int sasl_sc_sasl2dn( Operation *o, SlapReply *rs )
+static int sasl_sc_sasl2dn( Operation *op, SlapReply *rs )
 {
-       struct berval *ndn = o->o_callback->sc_private;
+       struct berval *ndn = op->o_callback->sc_private;
 
-       if (rs->sr_type != REP_SEARCH) return 0;
+       if ( rs->sr_type != REP_SEARCH ) return LDAP_SUCCESS;
 
        /* We only want to be called once */
        if ( !BER_BVISNULL( ndn ) ) {
-               o->o_tmpfree(ndn->bv_val, o->o_tmpmemctx);
+               op->o_tmpfree( ndn->bv_val, op->o_tmpmemctx );
                BER_BVZERO( ndn );
 
                Debug( LDAP_DEBUG_TRACE,
-                       "slap_sc_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 );
-               return -1;
+                       "%s: slap_sc_sasl2dn: search DN returned more than 1 entry\n",
+                       op->o_log_prefix, 0, 0 );
+               return LDAP_OTHER;
        }
 
-       ber_dupbv_x(ndn, &rs->sr_entry->e_nname, o->o_tmpmemctx);
-       return 0;
+       ber_dupbv_x( ndn, &rs->sr_entry->e_nname, op->o_tmpmemctx );
+       return LDAP_SUCCESS;
 }
 
 
index ab6fd7efdbcfb171d7dc2216359792098dc43dcf..f19e0a99937c4363b28553995ba3ff5356131eae 100644 (file)
@@ -2937,8 +2937,11 @@ parse_syncrepl_line(
                        } else if ( strchr( val, ':' ) != NULL ) {
                                char *next, *ptr = val;
                                unsigned dd, hh, mm, ss;
+                               
+                               /* NOTE: the test for ptr[ 0 ] == '-'
+                                * should go before the call to strtoul() */
                                dd = strtoul( ptr, &next, 10 );
-                               if ( next == ptr || next[0] != ':' ) {
+                               if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' ) {
                                        snprintf( c->msg, sizeof( c->msg ),
                                                "Error: parse_syncrepl_line: "
                                                "invalid interval \"%s\", unable to parse days", val );
@@ -2947,7 +2950,7 @@ parse_syncrepl_line(
                                }
                                ptr = next + 1;
                                hh = strtoul( ptr, &next, 10 );
-                               if ( next == ptr || next[0] != ':' || hh > 24 ) {
+                               if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' || hh > 24 ) {
                                        snprintf( c->msg, sizeof( c->msg ),
                                                "Error: parse_syncrepl_line: "
                                                "invalid interval \"%s\", unable to parse hours", val );
@@ -2956,7 +2959,7 @@ parse_syncrepl_line(
                                }
                                ptr = next + 1;
                                mm = strtoul( ptr, &next, 10 );
-                               if ( next == ptr || next[0] != ':' || mm > 60 ) {
+                               if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' || mm > 60 ) {
                                        snprintf( c->msg, sizeof( c->msg ),
                                                "Error: parse_syncrepl_line: "
                                                "invalid interval \"%s\", unable to parse minutes", val );
@@ -2965,7 +2968,7 @@ parse_syncrepl_line(
                                }
                                ptr = next + 1;
                                ss = strtoul( ptr, &next, 10 );
-                               if ( next == ptr || next[0] != '\0' || ss > 60 ) {
+                               if ( ptr[ 0 ] == '-' || next == ptr || next[0] != '\0' || ss > 60 ) {
                                        snprintf( c->msg, sizeof( c->msg ),
                                                "Error: parse_syncrepl_line: "
                                                "invalid interval \"%s\", unable to parse seconds", val );