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>
Wed, 28 Sep 2011 14:54:58 +0000 (16:54 +0200)
It did not compare the last charcter (usually '\0')

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Sep 28 16:54:59 CEST 2011 on sn-devel-104

source3/lib/dbwrap/dbwrap_ctdb.c

index d9fb48950c86d96184e3f1b401c6bd9a9526ec50..84d7b2fc2fb378a8d97ba1bc3233feb87129e31e 100644 (file)
@@ -1267,8 +1267,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;
        }