s3:dbwrap_ctdb: improve the check for skipping the __db_sequence_number__ record...
authorMichael Adam <obnox@samba.org>
Tue, 27 Sep 2011 14:06:48 +0000 (16:06 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 11 Oct 2011 13:21:13 +0000 (15:21 +0200)
It did not compare the last charcter (usually '\0')

source3/lib/dbwrap_ctdb.c

index e7b93551cf7d813f9fe64ea8fe2e1078d41d01a8..db16b35a3039d4b96256a14d66c61fb0a81040ae 100644 (file)
@@ -1250,8 +1250,7 @@ static int traverse_persistent_callback(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DAT
         * This is used for persistent transactions internally.
         */
        if (kbuf.dsize == strlen(CTDB_DB_SEQNUM_KEY) + 1 &&
-           strncmp((const char*)kbuf.dptr, CTDB_DB_SEQNUM_KEY,
-                   strlen(CTDB_DB_SEQNUM_KEY)) == 0)
+           strcmp((const char*)kbuf.dptr, CTDB_DB_SEQNUM_KEY))
        {
                goto done;
        }