From 1cae59ce112ccb51b45357a52b902f80fce1eef1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 28 Aug 2013 11:34:08 +0000 Subject: dbwrap_ctdb: Treat empty records as non-existing This is a patch implementing the workaround Christian mentioned in https://bugzilla.samba.org/show_bug.cgi?id=10008#c5 Bug: https://bugzilla.samba.org/show_bug.cgi?id=10008 Signed-off-by: Volker Lendecke Reviewed-by: Christian Ambach --- source3/lib/dbwrap/dbwrap_ctdb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/lib/dbwrap') diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index f90e7b80f1..5a473f98af 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -103,6 +103,16 @@ static int db_ctdb_ltdb_parser(TDB_DATA key, TDB_DATA data, if (data.dsize < sizeof(struct ctdb_ltdb_header)) { return -1; } + if (data.dsize == sizeof(struct ctdb_ltdb_header)) { + /* + * Making this a separate case that needs fixing + * separately. This is an empty record. ctdbd does not + * distinguish between empty and deleted records. Samba right + * now can live without empty records, so lets treat zero-size + * (i.e. deleted) records as non-existing. + */ + return -1; + } state->parser( key, (struct ctdb_ltdb_header *)data.dptr, make_tdb_data(data.dptr + sizeof(struct ctdb_ltdb_header), -- cgit