summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_control.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-06-26 20:12:23 +1000
committerMartin Schwenke <martins@samba.org>2018-07-02 08:51:22 +0200
commit63255ef92552da92956c05160f33622d0bbc3a28 (patch)
tree56d7c596e588221c82b1122da02a9bb4de50f31c /ctdb/server/ctdb_control.c
parentaf446d5209e37a38363911e5f339869b73d87963 (diff)
downloadsamba-63255ef92552da92956c05160f33622d0bbc3a28.tar.gz
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>
Diffstat (limited to 'ctdb/server/ctdb_control.c')
-rw-r--r--ctdb/server/ctdb_control.c32
1 files changed, 24 insertions, 8 deletions
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);