The Samba-Bugzilla – Attachment 14285 Details for
Bug 13500
Creating missing remote databases during recovery can fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for v4.8
BZ13500-v4-8.patch (text/plain), 4.15 KB, created by
Martin Schwenke
on 2018-07-06 01:50:19 UTC
(
hide
)
Description:
Patch for v4.8
Filename:
MIME Type:
Creator:
Martin Schwenke
Created:
2018-07-06 01:50:19 UTC
Size:
4.15 KB
patch
obsolete
>From 3c7b94d11bffb4eea2618d5c2d15026fe8def1d6 Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Tue, 26 Jun 2018 20:12:23 +1000 >Subject: [PATCH] ctdb-daemon: Only consider client ID for local database > attach > >The comment immediately above this code says "don't allow local >clients to attach" and then looks up the client ID regardless of >whether the request is local or remote. > >This means that an intentional remote attach from a client will not >work correctly. No real client should ever do that since clients >attach so they an access databases locally. Perhaps some sanity >checks should be added. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13500 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit 63255ef92552da92956c05160f33622d0bbc3a28) >--- > ctdb/include/ctdb_private.h | 7 +++++-- > ctdb/server/ctdb_control.c | 32 ++++++++++++++++++++++++-------- > ctdb/server/ctdb_ltdb_server.c | 9 ++++++--- > 3 files changed, 35 insertions(+), 13 deletions(-) > >diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h >index 23cb7dcd53b..25d00476be2 100644 >--- a/ctdb/include/ctdb_private.h >+++ b/ctdb/include/ctdb_private.h >@@ -726,9 +726,12 @@ int ctdb_set_db_readonly(struct ctdb_context *ctdb, > > int ctdb_process_deferred_attach(struct ctdb_context *ctdb); > >-int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, >+int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, >+ TDB_DATA indata, > TDB_DATA *outdata, >- uint8_t db_flags, uint32_t client_id, >+ uint8_t db_flags, >+ uint32_t srcnode, >+ uint32_t client_id, > struct ctdb_req_control_old *c, > bool *async_reply); > int32_t ctdb_control_db_detach(struct ctdb_context *ctdb, TDB_DATA indata, >diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c >index b812980ddf9..848010e2310 100644 >--- a/ctdb/server/ctdb_control.c >+++ b/ctdb/server/ctdb_control.c >@@ -267,18 +267,34 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb, > } > > case CTDB_CONTROL_DB_ATTACH: >- return ctdb_control_db_attach(ctdb, indata, outdata, 0, client_id, >- c, async_reply); >+ return ctdb_control_db_attach(ctdb, >+ indata, >+ outdata, >+ 0, >+ srcnode, >+ client_id, >+ c, >+ async_reply); > > case CTDB_CONTROL_DB_ATTACH_PERSISTENT: >- return ctdb_control_db_attach(ctdb, indata, outdata, >- CTDB_DB_FLAGS_PERSISTENT, client_id, >- c, async_reply); >+ return ctdb_control_db_attach(ctdb, >+ indata, >+ outdata, >+ CTDB_DB_FLAGS_PERSISTENT, >+ srcnode, >+ client_id, >+ c, >+ async_reply); > > case CTDB_CONTROL_DB_ATTACH_REPLICATED: >- return ctdb_control_db_attach(ctdb, indata, outdata, >- CTDB_DB_FLAGS_REPLICATED, client_id, >- c, async_reply); >+ return ctdb_control_db_attach(ctdb, >+ indata, >+ outdata, >+ CTDB_DB_FLAGS_REPLICATED, >+ srcnode, >+ client_id, >+ c, >+ async_reply); > > case CTDB_CONTROL_SET_CALL: > return control_not_implemented("SET_CALL", NULL); >diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c >index 1962f854683..ca5bb124f5f 100644 >--- a/ctdb/server/ctdb_ltdb_server.c >+++ b/ctdb/server/ctdb_ltdb_server.c >@@ -1105,9 +1105,12 @@ int ctdb_process_deferred_attach(struct ctdb_context *ctdb) > /* > a client has asked to attach a new database > */ >-int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, >+int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, >+ TDB_DATA indata, > TDB_DATA *outdata, >- uint8_t db_flags, uint32_t client_id, >+ uint8_t db_flags, >+ uint32_t srcnode, >+ uint32_t client_id, > struct ctdb_req_control_old *c, > bool *async_reply) > { >@@ -1128,7 +1131,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, > * allow all attach from the network since these are always from remote > * recovery daemons. > */ >- if (client_id != 0) { >+ if (srcnode == ctdb->pnn && client_id != 0) { > client = reqid_find(ctdb->idr, client_id, struct ctdb_client); > } > if (client != NULL) { >-- >2.18.0 >
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:
amitay
:
review+
Actions:
View
Attachments on
bug 13500
:
14284
| 14285