Pierangelo Masarati wrote:
Mi first question is: is "rid=004,sid=000,csn=" a legitimate cookie?
As far as our implementation goes, no. slap_compose_sync_cookie() should
never
produce this.
I could reproduce it, but unfortunately I don't have much info available.
I have instrumented syncprov.c to log the cookie any time it is prepared,
and the incorrect cookie was generated by slap_compose_sync_cookie() when
invoked by syncprov_sendresp() after a successful add. I only saw the
log, so I couldn't inspect memory during that operation, so I'm trying to
narrow things down to a small and quickly reproducible example.
Apparently, opc->sctxcsn contains an empty berval, otherwise no "csn="
portion would apprear in the cookie.
I note that in syncprov_op_response(), if slap_get_commit_csn() can't get
a maxcsn, opc->sctxcsn would be set to an empty berval, and this would
trigger the above cookie. I wonder if this is possible at all, and if
setting opc->sctxcsn to a NULL berval would just cure the problem.