s3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.
authorMichael Adam <obnox@samba.org>
Fri, 11 Dec 2009 23:30:37 +0000 (00:30 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Apr 2010 07:39:15 +0000 (09:39 +0200)
Don't treat this as an error but return seqnum 0 instead.

Michael
(cherry picked from commit 10a44ee6930bb51b4b20ce42f35bc455ac1b7293)
(cherry picked from commit 8926082d096b2a6e8688b1668bd7293632ebb508)

source3/lib/dbwrap_ctdb.c

index fb99e1d9cf52c5265d6856dd5bd682c02f279a4c..4c4486c53971f775dc5a0d46f93e8765f1252b41 100644 (file)
@@ -685,10 +685,14 @@ static NTSTATUS db_ctdb_fetch_db_seqnum_from_db(struct db_ctdb_ctx *db,
        key.dsize = strlen(keyname) + 1;
 
        status = db_ctdb_ltdb_fetch(db, key, &header, mem_ctx, &data);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (!NT_STATUS_IS_OK(status) &&
+           !NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND))
+       {
                goto done;
        }
 
+       status = NT_STATUS_OK;
+
        if (data.dsize != sizeof(uint64_t)) {
                *seqnum = 0;
                goto done;