[SCM] Samba Shared Repository - branch v4-11-stable updated

Karolin Seeger kseeger at samba.org
Tue May 5 11:48:24 UTC 2020


The branch, v4-11-stable has been updated
       via  8f72e88335c VERSION: Disable GIT_SNAPSHOT for the 4.11.9 release.
       via  17ae6b047cc WHATSNEW: Add release notes for Samba 4.11.9.
       via  24e21906a33 s3: pass DCE RPC handle type to create_policy_hnd
       via  08c012642f7 ctdb: Fix a memleak
       via  40a7250da76 libsmb: Don't try to find posix stat info in SMBC_getatr()
       via  e12887cdaec VERSION: Bump version up to 4.11.9.
       via  94c0fbebc6c Merge tag 'samba-4.11.8' into v4-11-test
       via  34bfaafc77e s3/librpc/crypto: Fix double free with unresolved credential cache
       via  f7ff511bc26 testprogs: Add 'net ads join createupn' test also verifying the keytab
       via  d9709735d5b s3:libads: Fix ads_get_upn()
       via  fa3250fdac1 smbd: let delayed update handler also update on-disk timestamps
       via  c8b5d996ec7 smbd: let mark_file_modified() always call trigger_write_time_update()
       via  8dbdba4a315 smbd: remove stat call from mark_file_modified()
       via  dbff6af0acf smbd: avoid double chdir() in chdir_current_service()
       via  0a8d442fe53 smbd: flush pending writetime update when setting timestamps file
       via  4f5a5e5d6e7 smbd: flush pending writetime update when flushing file
       via  5f4a49bd9f6 smbd: always flush pending write time update when setting filesize
       via  16d837cb233 nsswitch: fix use-after-free causing segfault in _pam_delete_cred
       via  8159513ac73 ctdb-recoverd: Avoid dereferencing NULL rec->nodemap
       via  10592fcd018 ctdb-daemon: Don't allow attach from recovery if recovery is not active
       via  938dd246786 ctdb-daemon: Remove more unused old client database functions
       via  5ef3effeaed ctdb-recovery: Remove old code for creating missing databases
       via  9beb8edf596 ctdb-recovery: Create database on nodes where it is missing
       via  44b330ad02f ctdb-recovery: Fetch database name from all nodes where it is attached
       via  678a5c33d69 ctdb-recovery: Pass db structure for each database recovery
       via  0d89960f18c ctdb-recovery: GET_DBMAP from all nodes
       via  62bb07b7b72 ctdb-recovery: Replace use of ctdb_dbid_map with local db_list
       via  92b0fcf3a4e ctdb-daemon: Respect CTDB_CTRL_FLAG_ATTACH_RECOVERY when attaching databases
       via  835f091f80a ctdb-recovery: Use CTDB_CTRL_FLAG_ATTACH_RECOVERY to attach during recovery
       via  c42aec419ff ctdb-protocol: Add control flag CTDB_CTRL_FLAG_ATTACH_RECOVERY
       via  eac703c1d31 ctdb-daemon: Remove unused old client database functions
       via  ac738d067ac ctdb-daemon: Fix database attach deferral logic
       via  436a746ed1a ctdb-recovery: Refactor banning a node into separate computation
       via  3640f428b13 ctdb-recovery: Don't trust nodemap obtained from local node
       via  3fa7d0c2ba4 ctdb-recovery: Consolidate node state
       via  1b703e591b6 ctdb-recovery: Fetched vnnmap is never used, so don't fetch it
       via  64d6c40bf1d ctdb-client: Factor out function client_db_tdb()
       via  9c3b0d389ce ctdb-daemon: Implement DB_VACUUM control
       via  b87b08a540f ctdb-vacuum: Only schedule next vacuum event if vacuuuming is scheduled
       via  c20ae7c8bc3 ctdb-daemon: Factor out code to create vacuuming child
       via  6a48db92ea7 ctdb-vacuum: Simplify recording of in-progress vacuuming child
       via  f0bd906afe7 ctdb-protocol: Add marshalling for control DB_VACUUM
       via  9a9dc4f05f4 ctdb-protocol: Add marshalling for struct ctdb_db_vacuum
       via  d036521725d ctdb-protocol: Add new control CTDB_CONTROL_DB_VACUUM
       via  bfdd98317b4 ctdb-vacuum: Avoid processing any more packets
       via  30d8a00c8e8 ctdb-daemon: Avoid memory leak when packet is deferred
       via  1d73ad17ec6 ctdb-recoverd: No need for database detach handler
       via  0a2428cf9f3 ctdb-recoverd: Drop VACUUM_FETCH message handling
       via  9aa7e66651d ctdb-vacuum: Replace VACUUM_FETCH message with control
       via  190b34ff2cf ctdb-vacuum: Add processing of fetch queue
       via  ee045a05acb ctdb-daemon: Add implementation of VACUUM_FETCH control
       via  8b81e9e93af ctdb-tests: Add marshalling tests for new control
       via  3eb8470086f ctdb-protocol: Add marshalling for new control VACUUM_FETCH
       via  08f7a43dda5 ctdb-protocol: Add new control VACUUM_FETCH
       via  3564e7c2940 ctdb-tests: Drop code releated to obsolete controls
       via  42e293f7e2e ctdb-protocol: Drop code related to obsolete controls
       via  e7a6abca56a ctdb-client: Fix some typos in debug messages
       via  45fab149767 selftest: test samba-tool group commands with groupnames with brackets and spaces
       via  5608ab2f62d samba-tool group edit: use binary encoded group name
       via  f8525b2aa46 samba-tool group delete: use binary encoded group name
       via  b1d664f9541 samba-tool group move: use binary encoded group name
       via  6122aa423f2 samba-tool group listmembers: use binary encoded group names
       via  0d95ad22384 samba-tool group listmembers: find group members by groups SID
       via  f4fc8a04596 samba-tool group listmembers: handle group-does-not-exist error
       via  496424ebd63 samba-tool group listmembers: hide python backtracke on command error
       via  ab7fe462500 ctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect()
       via  482e40c0560 ctdb-tcp: Factor out function ctdb_tcp_start_outgoing()
       via  f1ed1860b07 ctdb-tcp: add ctdb_tcp_stop_incoming()
       via  8cfc1a398d1 ctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing()
       via  a1a955a77f9 ctdb-tcp: Remove redundant restart in ctdb_tcp_tnode_cb()
       via  42a76edd5d1 ctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb()
       via  04e5ac81498 ctdb-tcp: move free of inbound queue to TCP restart
       via  b6419a9e9fc ctdb-daemon: more logical whitespace, debug modernisation
       via  503427f7d67 ctdb-daemon: ensure restart() callback is called in half-connected state
       via  586ac88bca4 ctdb-daemon: Rename ctdb_context private_data to transport_data
       via  2cb3749ef90 ctdb-daemon: Rename ctdb_node private_data to transport_data
       via  aff55431702 nmblib: avoid undefined behaviour in handle_name_ptrs()
       via  14511bd7ccd vfs_recycle: prevent flooding the log if we're called on non-existant paths
       via  c98e8ec8566 librpc: fix IDL for svcctl_ChangeServiceConfigW
       via  a573ccf2d7c s4-torture: add ndr svcctl testsuite
       via  e66e8021b58 s4-torture: add rpc test for ChangeServiceConfigW
       via  dd1fd01b657 lib:torture: add torture_assert_u32_[not_]equal[_goto] macros
       via  d65993a65ff VFS: default: add support for FILE_ATTRIBUTE_OFFLINE to async dosmode
       via  a0111dc1953 VFS: default: use correct type for pathlen in vfswrap_getxattrat_do_sync()
       via  15f60af436c VFS: default: avoid a crash in vfswrap_getxattrat_do_sync()
       via  56d86e3d55a VFS: default: remove unused arg from vfswrap_is_offline()
       via  6b3b348382b VFS: default: let vfswrap_is_offline() take conn, not handle
       via  703eeec9b31 smbd: ignore set NTACL requests which contain S-1-5-88 NFS ACEs
       via  1b67228799f vfs_fruit: tmsize prevent overflow Force the type during arithmetic in order to prevent overflow when summing the Time Machine folder size. Increase the precision to off_t (used for file sizes), leave the overflow error traps but with more precise wording.
       via  6a2a635a5dd smbd: avoid calling vfs_file_id_from_sbuf() if statinfo is not valid
       via  46e19f9f402 VERSION: Bump version up to 4.11.7...
      from  86c951a1336 VERSION: Disable GIT_SNAPSHOT for the 4.11.8 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-11-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                       |    2 +-
 WHATSNEW.txt                                  |   90 +-
 ctdb/client/client_db.c                       |   47 +-
 ctdb/client/client_private.h                  |    4 +
 ctdb/ib/ibw_ctdb.c                            |   11 +-
 ctdb/ib/ibw_ctdb_init.c                       |   13 +-
 ctdb/include/ctdb_client.h                    |   34 -
 ctdb/include/ctdb_private.h                   |   16 +-
 ctdb/protocol/protocol.h                      |   10 +
 ctdb/protocol/protocol_api.h                  |    8 +
 ctdb/protocol/protocol_client.c               |   57 +-
 ctdb/protocol/protocol_control.c              |  107 +-
 ctdb/protocol/protocol_debug.c                |    2 +
 ctdb/protocol/protocol_private.h              |   10 +
 ctdb/protocol/protocol_types.c                |   63 ++
 ctdb/server/ctdb_client.c                     |  242 ----
 ctdb/server/ctdb_control.c                    |   12 +
 ctdb/server/ctdb_freeze.c                     |    9 +-
 ctdb/server/ctdb_ltdb_server.c                |   27 +-
 ctdb/server/ctdb_recoverd.c                   |  354 +-----
 ctdb/server/ctdb_recovery_helper.c            | 1478 ++++++++++++++++++-------
 ctdb/server/ctdb_server.c                     |   16 +-
 ctdb/server/ctdb_vacuum.c                     |  535 +++++++--
 ctdb/tcp/ctdb_tcp.h                           |    3 +-
 ctdb/tcp/tcp_connect.c                        |   82 +-
 ctdb/tcp/tcp_init.c                           |   20 +-
 ctdb/tcp/tcp_io.c                             |    5 +-
 ctdb/tests/cunit/protocol_test_101.sh         |    2 +-
 ctdb/tests/src/protocol_common.c              |   13 +
 ctdb/tests/src/protocol_common.h              |    4 +
 ctdb/tests/src/protocol_common_ctdb.c         |  108 +-
 ctdb/tests/src/protocol_ctdb_test.c           |    2 +-
 ctdb/tests/src/protocol_types_test.c          |    2 +
 examples/winexe/winexe.c                      |    2 +
 lib/torture/torture.h                         |   48 +
 librpc/idl/svcctl.idl                         |   25 +-
 nsswitch/pam_winbind.c                        |    2 +-
 python/samba/netcmd/group.py                  |   41 +-
 python/samba/tests/samba_tool/group.py        |    3 +-
 selftest/knownfail                            |    3 +
 source3/include/libsmb_internal.h             |    1 -
 source3/libads/ldap.c                         |    1 +
 source3/librpc/crypto/gse.c                   |    4 -
 source3/libsmb/libsmb_file.c                  |   20 -
 source3/libsmb/libsmb_server.c                |    9 -
 source3/libsmb/nmblib.c                       |    3 +
 source3/modules/nfs4_acls.c                   |    4 +
 source3/modules/vfs_default.c                 |   49 +-
 source3/modules/vfs_fruit.c                   |   12 +-
 source3/modules/vfs_recycle.c                 |    4 +-
 source3/rpc_server/epmapper/srv_epmapper.c    |    7 +-
 source3/rpc_server/eventlog/srv_eventlog_nt.c |    2 +-
 source3/rpc_server/lsa/srv_lsa_nt.c           |    2 +-
 source3/rpc_server/mdssvc/srv_mdssvc_nt.c     |    2 +-
 source3/rpc_server/rpc_handles.c              |   30 +-
 source3/rpc_server/rpc_pipes.h                |   19 +-
 source3/rpc_server/samr/srv_samr_nt.c         |   84 +-
 source3/rpc_server/spoolss/srv_spoolss_nt.c   |    2 +-
 source3/rpc_server/svcctl/srv_svcctl_nt.c     |    2 +-
 source3/rpc_server/winreg/srv_winreg_nt.c     |    6 +-
 source3/smbd/fileio.c                         |   17 +-
 source3/smbd/open.c                           |   10 +-
 source3/smbd/reply.c                          |   11 +
 source3/smbd/service.c                        |   25 +-
 source3/smbd/smb2_flush.c                     |    7 +
 source3/smbd/trans2.c                         |   32 +-
 source4/torture/ndr/ndr.c                     |    1 +
 source4/torture/ndr/svcctl.c                  |   88 ++
 source4/torture/rpc/svcctl.c                  |   81 +-
 source4/torture/wscript_build                 |    1 +
 testprogs/blackbox/test_net_ads.sh            |   17 +
 71 files changed, 2587 insertions(+), 1478 deletions(-)
 create mode 100644 source4/torture/ndr/svcctl.c


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index d721f86d116..c13672ee895 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=11
-SAMBA_VERSION_RELEASE=8
+SAMBA_VERSION_RELEASE=9
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 3502516273e..e4af7cb4105 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,89 @@
+                   ==============================
+                   Release Notes for Samba 4.11.9
+                            May 05, 2020
+		   ==============================
+
+
+This is the latest stable release of the Samba 4.11 release series.
+
+
+Changes since 4.11.8
+--------------------
+
+o  Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
+   * BUG 14242: nmblib: Avoid undefined behaviour in handle_name_ptrs().
+
+o  Björn Baumbach <bb at sernet.de>
+   * BUG 14296: 'samba-tool group' commands do not handle group names with
+     special chars correctly.
+
+o  Ralph Boehme <slow at samba.org>
+   * BUG 14237: smbd: avoid calling vfs_file_id_from_sbuf() if statinfo is not
+     valid.
+   * BUG 14293: Missing check for DMAPI offline status in async DOS attributes.
+   * BUG 14307: smbd: Ignore set NTACL requests which contain S-1-5-88 NFS ACEs.
+   * BUG 14316: vfs_recycle: Prevent flooding the log if we're called on
+     non-existant paths.
+   * BUG 14320: smbd mistakenly updates a file's write-time on close.
+
+o  Alexander Bokovoy <ab at samba.org>
+   * BUG 14359: RPC handles cannot be differentiated in source3 RPC server.
+
+o  Günther Deschner <gd at samba.org>
+   * BUG 14313: librpc: Fix IDL for svcctl_ChangeServiceConfigW.
+   * BUG 14327: nsswitch: Fix use-after-free causing segfault in
+     _pam_delete_cred.
+
+o  Art M. Gallagher <repos at artmg.net>
+   * BUG 13622: Fix fruit:time machine max size on arm.
+
+o  Amitay Isaacs <amitay at gmail.com>
+   * BUG 14294: CTDB recovery corner cases can cause record resurrection and
+     node banning.
+
+o  Volker Lendecke <vl at samba.org>
+   * BUG 14348: ctdb: Fix a memleak.
+   * libsmb: Don't try to find posix stat info in SMBC_getatr().
+
+o  Noel Power <noel.power at suse.com>
+   * BUG 14295: ctdb-tcp: Move free of inbound queue to TCP restart.
+   * BUG 14344: s3/librpc/crypto: Fix double free with unresolved credential
+     cache.
+
+o  Andreas Schneider <asn at samba.org>
+   * BUG 14336: s3:libads: Fix ads_get_upn().
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 14294: CTDB recovery corner cases can cause record resurrection and
+     node banning.
+   * BUG 14295: Starting ctdb node that was powered off hard before results in
+     recovery loop.
+   * BUG 14324: ctdb-recoverd: Avoid dereferencing NULL rec->nodemap.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
                    ==============================
                    Release Notes for Samba 4.11.8
                            April 28, 2020
@@ -56,8 +142,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
                    ==============================
                    Release Notes for Samba 4.11.7
diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c
index dfa8d970de5..0b06d6e5e52 100644
--- a/ctdb/client/client_db.c
+++ b/ctdb/client/client_db.c
@@ -37,6 +37,11 @@
 #include "client/client_private.h"
 #include "client/client.h"
 
+struct tdb_context *client_db_tdb(struct ctdb_db_context *db)
+{
+	return db->ltdb->tdb;
+}
+
 static struct ctdb_db_context *client_db_handle(
 					struct ctdb_client_context *client,
 					const char *db_name)
@@ -835,11 +840,11 @@ int ctdb_db_traverse_local(struct ctdb_db_context *db, bool readonly,
 	state.error = 0;
 
 	if (readonly) {
-		ret = tdb_traverse_read(db->ltdb->tdb,
+		ret = tdb_traverse_read(client_db_tdb(db),
 					ctdb_db_traverse_local_handler,
 					&state);
 	} else {
-		ret = tdb_traverse(db->ltdb->tdb,
+		ret = tdb_traverse(client_db_tdb(db),
 				   ctdb_db_traverse_local_handler, &state);
 	}
 
@@ -1105,14 +1110,14 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *db, TDB_DATA key,
 	size_t np;
 	int ret;
 
-	rec = tdb_fetch(db->ltdb->tdb, key);
+	rec = tdb_fetch(client_db_tdb(db), key);
 	if (rec.dsize < sizeof(struct ctdb_ltdb_header)) {
 		/* No record present */
 		if (rec.dptr != NULL) {
 			free(rec.dptr);
 		}
 
-		if (tdb_error(db->ltdb->tdb) != TDB_ERR_NOEXIST) {
+		if (tdb_error(client_db_tdb(db)) != TDB_ERR_NOEXIST) {
 			return EIO;
 		}
 
@@ -1235,18 +1240,18 @@ static int ctdb_fetch_lock_check(struct tevent_req *req)
 	int ret, err = 0;
 	bool do_migrate = false;
 
-	ret = tdb_chainlock(h->db->ltdb->tdb, h->key);
+	ret = tdb_chainlock(client_db_tdb(h->db), h->key);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("fetch_lock: %s tdb_chainlock failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 		err = EIO;
 		goto failed;
 	}
 
-	data = tdb_fetch(h->db->ltdb->tdb, h->key);
+	data = tdb_fetch(client_db_tdb(h->db), h->key);
 	if (data.dptr == NULL) {
-		if (tdb_error(h->db->ltdb->tdb) == TDB_ERR_NOEXIST) {
+		if (tdb_error(client_db_tdb(h->db)) == TDB_ERR_NOEXIST) {
 			goto migrate;
 		} else {
 			err = EIO;
@@ -1297,11 +1302,11 @@ failed:
 	if (data.dptr != NULL) {
 		free(data.dptr);
 	}
-	ret = tdb_chainunlock(h->db->ltdb->tdb, h->key);
+	ret = tdb_chainunlock(client_db_tdb(h->db), h->key);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("fetch_lock: %s tdb_chainunlock failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 		return EIO;
 	}
 
@@ -1377,11 +1382,11 @@ static int ctdb_record_handle_destructor(struct ctdb_record_handle *h)
 {
 	int ret;
 
-	ret = tdb_chainunlock(h->db->ltdb->tdb, h->key);
+	ret = tdb_chainunlock(client_db_tdb(h->db), h->key);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("fetch_lock: %s tdb_chainunlock failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 	}
 	free(h->data.dptr);
 	return 0;
@@ -1487,11 +1492,11 @@ int ctdb_store_record(struct ctdb_record_handle *h, TDB_DATA data)
 	rec[1].dsize = data.dsize;
 	rec[1].dptr = data.dptr;
 
-	ret = tdb_storev(h->db->ltdb->tdb, h->key, rec, 2, TDB_REPLACE);
+	ret = tdb_storev(client_db_tdb(h->db), h->key, rec, 2, TDB_REPLACE);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,
 		      ("store_record: %s tdb_storev failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		       h->db->db_name, tdb_errorstr(client_db_tdb(h->db))));
 		return EIO;
 	}
 
@@ -1538,11 +1543,11 @@ struct tevent_req *ctdb_delete_record_send(TALLOC_CTX *mem_ctx,
 	rec.dsize = np;
 	rec.dptr = header;
 
-	ret = tdb_store(h->db->ltdb->tdb, h->key, rec, TDB_REPLACE);
+	ret = tdb_store(client_db_tdb(h->db), h->key, rec, TDB_REPLACE);
 	if (ret != 0) {
-		DEBUG(DEBUG_ERR,
-		      ("fetch_lock delete: %s tdb_sore failed, %s\n",
-		       h->db->db_name, tdb_errorstr(h->db->ltdb->tdb)));
+		D_ERR("fetch_lock delete: %s tdb_store failed, %s\n",
+		      h->db->db_name,
+		      tdb_errorstr(client_db_tdb(h->db)));
 		tevent_req_error(req, EIO);
 		return tevent_req_post(req, ev);
 	}
@@ -1576,9 +1581,9 @@ static void ctdb_delete_record_done(struct tevent_req *subreq)
 	status = ctdb_client_control_recv(subreq, &ret, NULL, NULL);
 	TALLOC_FREE(subreq);
 	if (! status) {
-		DEBUG(DEBUG_ERR,
-		      ("delete_record: %s SCHDULE_FOR_DELETION failed, "
-		       "ret=%d\n", state->h->db->db_name, ret));
+		D_ERR("delete_record: %s SCHEDULE_FOR_DELETION failed, ret=%d\n",
+		      state->h->db->db_name,
+		      ret);
 		tevent_req_error(req, ret);
 		return;
 	}
diff --git a/ctdb/client/client_private.h b/ctdb/client/client_private.h
index bb1705534e6..0bb2ad590ea 100644
--- a/ctdb/client/client_private.h
+++ b/ctdb/client/client_private.h
@@ -77,6 +77,10 @@ struct ctdb_tunnel_context {
 void ctdb_client_reply_call(struct ctdb_client_context *client,
 			    uint8_t *buf, size_t buflen, uint32_t reqid);
 
+/* From client_db.c */
+
+struct tdb_context *client_db_tdb(struct ctdb_db_context *db);
+
 /* From client_message.c */
 
 void ctdb_client_req_message(struct ctdb_client_context *client,
diff --git a/ctdb/ib/ibw_ctdb.c b/ctdb/ib/ibw_ctdb.c
index 458646faae0..53911240ff7 100644
--- a/ctdb/ib/ibw_ctdb.c
+++ b/ctdb/ib/ibw_ctdb.c
@@ -55,7 +55,8 @@ int ctdb_ibw_get_address(struct ctdb_context *ctdb,
 
 int ctdb_ibw_node_connect(struct ctdb_node *node)
 {
-	struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+	struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+						   struct ctdb_ibw_node);
 	int	rc;
 
 	assert(cn!=NULL);
@@ -118,7 +119,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
 		case IBWC_CONNECTED: { /* after ibw_accept or ibw_connect */
 			struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
 			if (node!=NULL) { /* after ibw_connect */
-				struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+				struct ctdb_ibw_node *cn = talloc_get_type(
+					node->transport_data,
+					struct ctdb_ibw_node);
 
 				node->ctdb->upcalls->node_connected(node);
 				ctdb_flush_cn_queue(cn);
@@ -136,7 +139,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
 		case IBWC_ERROR: {
 			struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
 			if (node!=NULL) {
-				struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+				struct ctdb_ibw_node *cn = talloc_get_type(
+					node->transport_data,
+					struct ctdb_ibw_node);
 				struct ibw_ctx *ictx = cn->conn->ctx;
 
 				DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));
diff --git a/ctdb/ib/ibw_ctdb_init.c b/ctdb/ib/ibw_ctdb_init.c
index 7e77ec08031..f9d00c60605 100644
--- a/ctdb/ib/ibw_ctdb_init.c
+++ b/ctdb/ib/ibw_ctdb_init.c
@@ -40,7 +40,8 @@
 
 static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
 {
-	struct ibw_ctx *ictx = talloc_get_type(ctdb->private_data, struct ibw_ctx);
+	struct ibw_ctx *ictx = talloc_get_type(ctdb->transport_data,
+					       struct ibw_ctx);
 
 	assert(ictx!=NULL);
 
@@ -62,12 +63,13 @@ static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
  */
 static int ctdb_ibw_add_node(struct ctdb_node *node)
 {
-	struct ibw_ctx *ictx = talloc_get_type(node->ctdb->private_data, struct ibw_ctx);
+	struct ibw_ctx *ictx = talloc_get_type(node->ctdb->transport_data,
+					       struct ibw_ctx);
 	struct ctdb_ibw_node *cn = talloc_zero(node, struct ctdb_ibw_node);
 
 	assert(cn!=NULL);
 	cn->conn = ibw_conn_new(ictx, node);
-	node->private_data = (void *)cn;
+	node->transport_data = (void *)cn;
 
 	return (cn->conn!=NULL ? 0 : -1);
 }
@@ -153,7 +155,8 @@ int ctdb_flush_cn_queue(struct ctdb_ibw_node *cn)
 
 static int ctdb_ibw_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
 {
-	struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+	struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+						   struct ctdb_ibw_node);
 	int	rc;
 
 	assert(length>=sizeof(uint32_t));
@@ -245,7 +248,7 @@ int ctdb_ibw_init(struct ctdb_context *ctdb)
 	}
 
 	ctdb->methods = &ctdb_ibw_methods;
-	ctdb->private_data = ictx;
+	ctdb->transport_data = ictx;
 	
 	DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init succeeded.\n"));
 	return 0;
diff --git a/ctdb/include/ctdb_client.h b/ctdb/include/ctdb_client.h
index ef4950ab533..198a8a38dbb 100644
--- a/ctdb/include/ctdb_client.h
+++ b/ctdb/include/ctdb_client.h
@@ -165,10 +165,6 @@ int ctdb_ctrl_getrecmaster(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
 int ctdb_ctrl_setrecmaster(struct ctdb_context *ctdb, struct timeval timeout,
 			   uint32_t destnode, uint32_t recmaster);
 
-int ctdb_ctrl_getdbmap(struct ctdb_context *ctdb, struct timeval timeout,
-		       uint32_t destnode, TALLOC_CTX *mem_ctx,
-		       struct ctdb_dbid_map_old **dbmap);
-
 int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, struct timeval timeout,
 			 uint32_t destnode, TALLOC_CTX *mem_ctx,
 			 struct ctdb_node_map_old **nodemap);
@@ -176,39 +172,9 @@ int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, struct timeval timeout,
 int ctdb_ctrl_get_runstate(struct ctdb_context *ctdb, struct timeval timeout,
 			   uint32_t destnode, uint32_t *runstate);
 
-int ctdb_ctrl_getdbpath(struct ctdb_context *ctdb, struct timeval timeout,
-			uint32_t destnode, uint32_t dbid,
-			TALLOC_CTX *mem_ctx, const char **path);
-int ctdb_ctrl_getdbname(struct ctdb_context *ctdb, struct timeval timeout,
-			uint32_t destnode, uint32_t dbid,
-			TALLOC_CTX *mem_ctx, const char **name);
-
-int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout,
-		       uint32_t destnode, TALLOC_CTX *mem_ctx,
-		       const char *name, uint8_t db_flags, uint32_t *db_id);
-
 int ctdb_ctrl_get_debuglevel(struct ctdb_context *ctdb, uint32_t destnode,
 			     int32_t *level);
 
-/*
-  attach to a ctdb database
-*/
-int ctdb_ctrl_db_open_flags(struct ctdb_context *ctdb, uint32_t db_id,
-			    int *tdb_flags);
-
-struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb,
-				    struct timeval timeout,
-				    const char *name,
-				    uint8_t db_flags);
-
-/* a ctdb call function */
-typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
-
-/*
-  setup a ctdb call function
-*/
-int ctdb_set_call(struct ctdb_db_context *ctdb_db, ctdb_fn_t fn, uint32_t id);
-
 int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout,
 		     uint32_t destnode);
 
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 1f168dae2b8..2f37db36e0c 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -36,6 +36,8 @@ struct ctdb_tcp_array {
 /*
   an installed ctdb remote call
 */
+typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
+
 struct ctdb_registered_call {
 	struct ctdb_registered_call *next, *prev;
 	uint32_t id;
@@ -74,7 +76,7 @@ struct ctdb_node {
 	struct ctdb_context *ctdb;
 	ctdb_sock_addr address;
 	const char *name; /* for debug messages */
-	void *private_data; /* private to transport */
+	void *transport_data; /* private to transport */
 	uint32_t pnn;
 	uint32_t flags;
 
@@ -286,7 +288,7 @@ struct ctdb_context {
 	char *err_msg;
 	const struct ctdb_methods *methods; /* transport methods */
 	const struct ctdb_upcalls *upcalls; /* transport upcalls */
-	void *private_data; /* private to transport */
+	void *transport_data; /* private to transport */
 	struct ctdb_db_context *db_list;
 	struct srvid_context *srv;
 	struct srvid_context *tunnels;
@@ -318,7 +320,7 @@ struct ctdb_context {
 
 	TALLOC_CTX *banning_ctx;
 
-	struct ctdb_vacuum_child_context *vacuumers;
+	struct ctdb_vacuum_child_context *vacuumer;
 
 	/* mapping from pid to ctdb_client * */
 	struct ctdb_client_pid_list *client_pids;
@@ -359,6 +361,7 @@ struct ctdb_db_context {
 	struct revokechild_handle *revokechild_active;
 	struct ctdb_persistent_state *persistent_state;
 	struct trbt_tree *delete_queue;
+	struct trbt_tree *fetch_queue;
 	struct trbt_tree *sticky_records; 
 	int (*ctdb_ltdb_store_fn)(struct ctdb_db_context *ctdb_db,
 				  TDB_DATA key,
@@ -985,6 +988,11 @@ int32_t ctdb_control_uptime(struct ctdb_context *ctdb, TDB_DATA *outdata);
 
 /* from ctdb_vacuum.c */
 
+int32_t ctdb_control_db_vacuum(struct ctdb_context *ctdb,
+			       struct ctdb_req_control_old *c,
+			       TDB_DATA indata,
+			       bool *async_reply);
+
 void ctdb_stop_vacuuming(struct ctdb_context *ctdb);
 int ctdb_vacuum_init(struct ctdb_db_context *ctdb_db);
 
@@ -998,6 +1006,8 @@ void ctdb_local_remove_from_delete_queue(struct ctdb_db_context *ctdb_db,
 					 const struct ctdb_ltdb_header *hdr,
 					 const TDB_DATA key);
 
+int32_t ctdb_control_vacuum_fetch(struct ctdb_context *ctdb, TDB_DATA indata);
+
 /* from eventscript.c */
 
 int ctdb_start_eventd(struct ctdb_context *ctdb);
diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index b868553f6e8..04a651018be 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -373,6 +373,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
 		    CTDB_CONTROL_CHECK_PID_SRVID         = 151,
 		    CTDB_CONTROL_TUNNEL_REGISTER         = 152,
 		    CTDB_CONTROL_TUNNEL_DEREGISTER       = 153,
+		    CTDB_CONTROL_VACUUM_FETCH            = 154,
+		    CTDB_CONTROL_DB_VACUUM               = 155,
 };
 
 #define MAX_COUNT_BUCKETS 16
@@ -851,6 +853,12 @@ struct ctdb_pid_srvid {
 	uint64_t srvid;
 };
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list