]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syncrepl.c
ITS#7735 fix memctx usage in prev commit
[openldap] / servers / slapd / syncrepl.c
index 4ffb3621af8573e11516e33c078e32c105aa6984..1e6e00c049b611343ed9b633b34dfc4de1d9a420 100644 (file)
@@ -590,7 +590,8 @@ check_syncprov(
                slap_compose_sync_cookie( NULL, &si->si_syncCookie.octet_str,
                        si->si_syncCookie.ctxcsn, si->si_syncCookie.rid,
                        si->si_syncCookie.sid );
-               slap_parse_sync_cookie( &si->si_syncCookie, NULL );
+               ch_free( si->si_syncCookie.sids );
+               slap_reparse_sync_cookie( &si->si_syncCookie, op->o_tmpmemctx );
        }
        ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
        return changed;
@@ -5083,14 +5084,15 @@ parse_syncrepl_line(
                                        STRLENOF( STRICT_REFRESH ) ) )
                {
                        si->si_strict_refresh = 1;
-               } else if ( bindconf_parse( c->argv[i], &si->si_bindconf ) ) {
+               } else if ( !bindconf_parse( c->argv[i], &si->si_bindconf ) ) {
+                       si->si_got |= GOT_BINDCONF;
+               } else {
                        snprintf( c->cr_msg, sizeof( c->cr_msg ),
                                "Error: parse_syncrepl_line: "
                                "unable to parse \"%s\"\n", c->argv[ i ] );
                        Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 );
                        return -1;
                }
-               si->si_got |= GOT_BINDCONF;
        }
 
        if ( ( si->si_got & GOT_REQUIRED ) != GOT_REQUIRED ) {
@@ -5104,11 +5106,11 @@ parse_syncrepl_line(
        }
 
        if ( !be_issubordinate( c->be, &si->si_base ) && !( si->si_got & GOT_SUFFIXM )) {
-               ch_free( si->si_base.bv_val );
-               BER_BVZERO( &si->si_base );
                snprintf( c->cr_msg, sizeof( c->cr_msg ),
                        "Base DN \"%s\" is not within the database naming context",
-                       val );
+                       si->si_base.bv_val );
+               ch_free( si->si_base.bv_val );
+               BER_BVZERO( &si->si_base );
                Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 );
                return -1;
        }