]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9691 Allow empty DB to host a persistent syncrepl session
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 13 Sep 2021 10:58:56 +0000 (11:58 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 12 Jan 2022 21:47:28 +0000 (21:47 +0000)
servers/slapd/overlays/syncprov.c

index ddadb71a3a4fccb8b4a2730b3c8fa21562e8f6ac..73450aa7924a1befb0416790bc7216f097a5c510 100644 (file)
@@ -3129,6 +3129,14 @@ syncprov_op_search( Operation *op, SlapReply *rs )
                op->o_callback = cb;
                ldap_pvt_thread_mutex_destroy( &so.s_mutex );
 
+               /* Special case, if client knows nothing, nor do we, keep going */
+               if ( srs->sr_state.numcsns == 0 && rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
+                       Debug( LDAP_DEBUG_SYNC, "%s syncprov_op_search: "
+                                       "both our DB and client empty, ignoring NO_SUCH_OBJECT\n",
+                                       op->o_log_prefix );
+                       rs->sr_err = LDAP_SUCCESS;
+               }
+
                if ( rs->sr_err != LDAP_SUCCESS ) {
                        send_ldap_result( op, rs );
                        return rs->sr_err;