The Samba-Bugzilla – Attachment 9200 Details for
Bug 10008
dbwrap_ctdb broken for deleted records in 4.1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
10008-4.1.patch (text/plain), 1.99 KB, created by
Volker Lendecke
on 2013-09-09 08:29:18 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Volker Lendecke
Created:
2013-09-09 08:29:18 UTC
Size:
1.99 KB
patch
obsolete
>From 254acdea4fa151c990835972ca2dfc6906f286a9 Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Wed, 28 Aug 2013 11:34:08 +0000 >Subject: [PATCH] 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 <vl@samba.org> >Reviewed-by: Christian Ambach <ambi@samba.org> >(cherry picked from commit 1cae59ce112ccb51b45357a52b902f80fce1eef1) >--- > source3/lib/ctdbd_conn.c | 8 ++++++++ > source3/lib/dbwrap/dbwrap_ctdb.c | 10 ++++++++++ > 2 files changed, 18 insertions(+) > >diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c >index 1481a9c..630b22e 100644 >--- a/source3/lib/ctdbd_conn.c >+++ b/source3/lib/ctdbd_conn.c >@@ -1475,6 +1475,14 @@ NTSTATUS ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id, > goto fail; > } > >+ if (reply->datalen == 0) { >+ /* >+ * Treat an empty record as non-existing >+ */ >+ status = NT_STATUS_NOT_FOUND; >+ goto fail; >+ } >+ > parser(key, make_tdb_data(&reply->data[0], reply->datalen), > private_data); > >diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c >index f90e7b8..5a473f9 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), >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
ambi
:
review+
obnox
:
review+
Actions:
View
Attachments on
bug 10008
: 9200