]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9015 Don't generate contextCSN on empty DB
authorOndřej Kuzník <ondra@openldap.org>
Mon, 29 Apr 2019 10:39:05 +0000 (11:39 +0100)
committerOndřej Kuzník <ondra@openldap.org>
Tue, 7 May 2019 18:03:35 +0000 (19:03 +0100)
servers/slapd/overlays/syncprov.c

index 259ac910a3478576c4be44ce8166477c19244151..c8e457c42038c549b647a173f19edc8450615d19 100644 (file)
@@ -3196,6 +3196,11 @@ syncprov_db_open(
                        /* Not in charge of this serverID, don't generate anything. */
                        goto out;
                }
+               if ( !SLAP_SYNC_SUBENTRY( be ) && rc != LDAP_SUCCESS
+                               && rc != LDAP_NO_SUCH_ATTRIBUTE ) {
+                       /* If the DB is genuinely empty, don't generate one either. */
+                       goto out;
+               }
                csn.bv_val = csnbuf;
                csn.bv_len = sizeof( csnbuf );
                slap_get_csn( op, &csn, 0 );