]> git.sur5r.net Git - openldap/commitdiff
Fix cookie search
authorHoward Chu <hyc@openldap.org>
Tue, 21 Oct 2003 08:26:58 +0000 (08:26 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 21 Oct 2003 08:26:58 +0000 (08:26 +0000)
servers/slapd/syncrepl.c

index b786bbe9b731858380d9db257102bb63abb0559d..9bc1778c1680da4d001fdb0d73d93221da8efff3 100644 (file)
@@ -225,7 +225,7 @@ do_syncrepl(
        Modifications   *modlist = NULL;
 
        char syncrepl_cbuf[sizeof(CN_STR SYNCREPL_STR)];
-       struct berval syncrepl_cn_bv = {sizeof(syncrepl_cbuf)-1, syncrepl_cbuf};
+       struct berval syncrepl_cn_bv;
 
        const char              *text;
        int                             match;
@@ -398,8 +398,9 @@ do_syncrepl(
 
        /* get syncrepl cookie of shadow replica from subentry */
 
-       snprintf(syncrepl_cbuf, sizeof(syncrepl_cbuf), CN_STR "syncrepl%d",
-               si->id );
+       syncrepl_cn_bv.bv_val = syncrepl_cbuf;
+       syncrepl_cn_bv.bv_len = snprintf(syncrepl_cbuf, sizeof(syncrepl_cbuf),
+               CN_STR "syncrepl%d", si->id );
        build_new_dn( &op.o_req_ndn, &si->base, &syncrepl_cn_bv, op.o_tmpmemctx );
        op.o_req_dn = op.o_req_ndn;