]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/syncprov.c
ITS#5705
[openldap] / servers / slapd / overlays / syncprov.c
index 241ad7e55246c084037b8d9190c5a9a05a0eef80..db113f042be0ff142df37556fb467e8ef86027f3 100644 (file)
@@ -393,9 +393,6 @@ static struct berval generic_filterstr = BER_BVC("(objectclass=*)");
 static int
 syncprov_findbase( Operation *op, fbase_cookie *fc )
 {
-       opcookie *opc = op->o_callback->sc_private;
-       slap_overinst *on = opc->son;
-
        /* Use basic parameters from syncrepl search, but use
         * current op's threadctx / tmpmemctx
         */
@@ -630,7 +627,7 @@ again:
                cf.f_av_value = si->si_ctxcsn[maxid];
                fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ),
                        "(entryCSN>=%s)", cf.f_av_value.bv_val );
-               if ( fop.ors_filterstr.bv_len < 0 || fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
+               if ( fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
                        return LDAP_OTHER;
                }
                fop.ors_attrsonly = 0;
@@ -667,7 +664,7 @@ again:
                        fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ),
                                "(entryCSN<=%s)", cf.f_av_value.bv_val );
                }
-               if ( fop.ors_filterstr.bv_len < 0 || fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
+               if ( fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
                        return LDAP_OTHER;
                }
                fop.ors_attrsonly = 1;
@@ -1338,7 +1335,7 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
        mod.sml_nvalues = NULL;
        mod.sml_desc = slap_schema.si_ad_contextCSN;
        mod.sml_op = LDAP_MOD_REPLACE;
-       mod.sml_flags = 0;
+       mod.sml_flags = SLAP_MOD_INTERNAL;
        mod.sml_next = NULL;
 
        cb.sc_response = slap_null_cb;
@@ -2535,7 +2532,7 @@ sp_cf_gen(ConfigArgs *c)
                                struct berval bv;
                                bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ),
                                        "%d %d", si->si_chkops, si->si_chktime );
-                               if ( bv.bv_len < 0 || bv.bv_len >= sizeof( c->cr_msg ) ) {
+                               if ( bv.bv_len >= sizeof( c->cr_msg ) ) {
                                        rc = 1;
                                } else {
                                        bv.bv_val = c->cr_msg;