diff options
author | Michael Adam <obnox@samba.org> | 2010-01-06 00:37:21 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-02-12 23:12:11 +0100 |
commit | 524072b56bf659002410a817749bf86fe6f51e83 (patch) | |
tree | 90970b4dde85293c96ba7691297afb6ada739e0a /source3/lib | |
parent | 1505b69dea6044a13a59f672e22f5833256cb981 (diff) | |
download | samba-524072b56bf659002410a817749bf86fe6f51e83.tar.gz samba-524072b56bf659002410a817749bf86fe6f51e83.tar.bz2 samba-524072b56bf659002410a817749bf86fe6f51e83.zip |
s3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().
The logic bug was that if a record was found in the marshall buffer,
then always the ctdb header of tha last record in the marshall buffer
was returned, and not the ctdb header of the last occurrence of the
requested record.
This is fixed by introducing an additional temporary variable.
Michael
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap_ctdb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c index d6fde3560d..4e97d26ae8 100644 --- a/source3/lib/dbwrap_ctdb.c +++ b/source3/lib/dbwrap_ctdb.c @@ -403,8 +403,11 @@ static bool pull_newest_from_marshall_buffer(struct ctdb_marshall_buffer *buf, for (i=0; i<buf->count; i++) { TDB_DATA tkey, tdata; uint32_t reqid; + struct ctdb_ltdb_header hdr; - rec = db_ctdb_marshall_loop_next(buf, rec, &reqid, &h, &tkey, + ZERO_STRUCT(hdr); + + rec = db_ctdb_marshall_loop_next(buf, rec, &reqid, &hdr, &tkey, &tdata); if (rec == NULL) { return false; @@ -413,6 +416,7 @@ static bool pull_newest_from_marshall_buffer(struct ctdb_marshall_buffer *buf, if (tdb_data_equal(key, tkey)) { found = true; data = tdata; + h = hdr; } } |