[SCM] Samba Shared Repository - branch v4-8-test updated

Karolin Seeger kseeger at samba.org
Mon May 7 12:26:02 UTC 2018


The branch, v4-8-test has been updated
       via  02b898e s3: libsmbclient: Fix hard-coded connection error return of ETIMEDOUT.
       via  dc7b7be s3:cleanupd: use MSG_SMB_BRL_VALIDATE to signal cleanupd unclean process shutdown
       via  0ccfe32 ceph: VFS: Add asynchronous fsync to ceph module, fake using synchronous call.
       via  bde6633 ctdb-client: Remove ununsed functions from old client code
       via  7cfaf700 rpc_server: Fix NetSessEnum with stale sessions
       via  2fcd26a selftest: Add testcase for querying sessions after smbd crash
       via  b7b0870 rpcclient: Print number of entries for NetSessEnum
       via  24a933e printing: return the same error code as windows does on upload failures
       via  81e7736 s3: tests: Regression test to ensure we can never return a DIRECTORY attribute on a stream.
       via  3d4a8f2 s3: smbd. Generic fix for incorrect reporting of stream dos attributes on a directory
       via  ace735e s3: vfs: vfs_streams_xattr: Don't blindly re-use the base file mode bits.
      from  13f23ec nsswitch: fix memory leak in winbind_open_pipe_sock() when the privileged pipe is not accessable.

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


- Log -----------------------------------------------------------------
commit 02b898e44d3b71670473cd7698b27d7448d0a96e
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 11:19:31 2018 -0700

    s3: libsmbclient: Fix hard-coded connection error return of ETIMEDOUT.
    
    We shouldn't hard-code the connection error as ETIMEDOUT when
    we have a perfectly good NT_STATUS to map from.
    
    Found by the ChromeOS guys trying to connect an SMB2-only client
    to an SMB1-only supporting server.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13419
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <Volker.Lendecke at SerNet.DE>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu May  3 02:42:20 CEST 2018 on sn-devel-144
    
    (cherry picked from commit 795ec751ac5f6e58966385bec25063c4af4f185d)
    
    Autobuild-User(v4-8-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-8-test): Mon May  7 14:25:28 CEST 2018 on sn-devel-144

commit dc7b7beeee61beab3d23a7678090208f7d345901
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Apr 30 19:03:41 2018 +0200

    s3:cleanupd: use MSG_SMB_BRL_VALIDATE to signal cleanupd unclean process shutdown
    
    Since 6423ca4bf293cac5e2f84b1a37bb29b06b5c05ed messaging_send_all()
    broadcasts messages in a cluster, so cleanupd receives those broadcasts
    and acts upon it by re-broadcasting the message. Result: message
    storm.
    
    By reactivating the currently unused MSG_SMB_BRL_VALIDATE for the
    trigger message to cleanupd we avoid the storm.
    
    Note that MSG_SMB_BRL_VALIDATE was unused only in the sense that noone
    *listened* to it, but we were still *sending* the message in
    smbd_parent_ctdb_reconfigured(). de6fe2a1dd6ab03b1c369b61da17fded72305b2d
    removed listening for MSG_SMB_BRL_VALIDATE from cleanupd. This commits
    brings it back.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13414
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit d3b9d11bade8bc52d08688ee66a4a20fe0a31a04)

commit 0ccfe32047e0214a262b9392ece677ac0bc085e1
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 27 14:25:54 2018 -0700

    ceph: VFS: Add asynchronous fsync to ceph module, fake using synchronous call.
    
    This will allow me to ultimately simplify the VFS by removing the synchronous
    fsync VFS call.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13412
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Mon Apr 30 21:48:55 CEST 2018 on sn-devel-144
    
    (cherry picked from commit aefe444d17a2eee3c0ff38bd34cf9e3f012ecf51)

commit bde663377381fed40bbba5f3e510987d16fa23cf
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Apr 30 19:32:13 2018 +1000

    ctdb-client: Remove ununsed functions from old client code
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13411
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (cherry picked from commit 01c8dc7e15b8764a9b8c8e34b84d0cab790edf47)

commit 7cfaf7000180c9308b18b1944dd41971f805bff1
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Apr 24 13:53:41 2018 -0700

    rpc_server: Fix NetSessEnum with stale sessions
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Apr 25 22:49:07 CEST 2018 on sn-devel-144
    
    (cherry picked from commit a6fade4e10760284ef56abf45d3fa70038091cbe)

commit 2fcd26a31b0f0fd3778cadc31b497f3c4e132bbd
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Apr 24 13:52:59 2018 -0700

    selftest: Add testcase for querying sessions after smbd crash
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit e04846c7df8e3eec1f3dbb2fc5eaf47ceb1c44d2)

commit b7b08709434f8bedf7158e90724f45fbf9a15985
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Apr 24 12:18:49 2018 -0700

    rpcclient: Print number of entries for NetSessEnum
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 501819fa9e7926c2f54cb92d508ac0e8437fd476)

commit 24a933e7bda083e0be16f1092c1c103eceb99608
Author: Björn Jacke <bjacke at samba.org>
Date:   Thu Apr 19 16:14:38 2018 +0200

    printing: return the same error code as windows does on upload failures
    
    Some print drivers inf files are broken and cause driver installation to fail
    on Samba servers. Windows returns WERR_APP_INIT_FAILURE in that case, we should
    do the same. Windows machines are less unlucky with that.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13395
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Wed Apr 25 13:55:25 CEST 2018 on sn-devel-144
    
    (cherry picked from commit 35f2afe411a3b22fb1befadb3bee8da1bc14753c)

commit 81e7736c745dcceb8c1ad3859e33fa8c8de6d47e
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Apr 11 10:33:22 2018 -0700

    s3: tests: Regression test to ensure we can never return a DIRECTORY attribute on a stream.
    
    Tests streams_xattr and also streams_depot.
    
    Inspired from a real-world test case by Andrew Walker <awalker at ixsystems.com>.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13380
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Apr 12 02:04:28 CEST 2018 on sn-devel-144
    
    (cherry picked from commit 82beaf868f252c4bc975ddafd80240af6f679b83)

commit 3d4a8f2c5f1f89415ae52539f3c99e6b0b52f020
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Apr 11 11:05:14 2018 -0700

    s3: smbd. Generic fix for incorrect reporting of stream dos attributes on a directory
    
    According to MS-FSA a stream name does not have
    separate DOS attribute metadata, so we must return
    the DOS attribute from the base filename. With one caveat,
    a non-default stream name can never be a directory.
    
    As this is common to all streams data stores, we handle
    it here instead of inside all stream VFS modules.
    
    Otherwise identical logic would have to be added to
    all streams modules in their [f]get_dos_attribute_fn()
    VFS calls.
    
    Found in real-world use case by Andrew Walker <awalker at ixsystems.com>.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13380
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    (cherry picked from commit 118e77d86a7171f589f805fa4f63246b0cb63672)

commit ace735eb2b23896ad43bbf570be818a8ad533b58
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Apr 11 08:41:00 2018 -0700

    s3: vfs: vfs_streams_xattr: Don't blindly re-use the base file mode bits.
    
    When returning the stat struct for an xattr stream,
    we originally base the st_ex_mode field on the value
    from the base file containing the xattr. If the base
    file is a directory, it will have S_IFDIR set in st_ex_mode,
    but streams can never be directories, they must be reported
    as regular files.
    
    The original code OR'ed in S_IFREG, but neglected to
    AND out S_IFDIR.
    
    Note this is not a complete to fix bug 13380 as
    it doesn't fix the generic case with all streams
    modules. See later fix and regression test.
    
    Found in real-world use case by Andrew Walker <awalker at ixsystems.com>.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13380
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    (cherry picked from commit 4d839d0f46b723ed6809bb932b9ebe4ead2cec82)

-----------------------------------------------------------------------

Summary of changes:
 ctdb/client/ctdb_client.c                          | 2535 +-------------------
 ctdb/include/ctdb_client.h                         |  218 --
 selftest/target/Samba3.pm                          |    4 +
 source3/libsmb/libsmb_server.c                     |    2 +-
 source3/modules/vfs_ceph.c                         |   53 +
 source3/modules/vfs_streams_xattr.c                |    2 +
 source3/printing/nt_printing.c                     |    2 +-
 source3/rpcclient/cmd_srvsvc.c                     |    2 +
 source3/script/tests/test_rpcclient_netsessenum.sh |   55 +
 source3/script/tests/test_smbclient_s3.sh          |   76 +
 source3/selftest/tests.py                          |    6 +
 source3/smbd/dosmode.c                             |   22 +
 source3/smbd/server.c                              |    2 +-
 source3/smbd/session.c                             |    4 +
 source3/smbd/smbd_cleanupd.c                       |    2 +-
 15 files changed, 345 insertions(+), 2640 deletions(-)
 create mode 100755 source3/script/tests/test_rpcclient_netsessenum.sh


Changeset truncated at 500 lines:

diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index d399cb5..635a488 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -584,354 +584,6 @@ int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
 
 
 /*
-  cancel a ctdb_fetch_lock operation, releasing the lock
- */
-static int fetch_lock_destructor(struct ctdb_record_handle *h)
-{
-	ctdb_ltdb_unlock(h->ctdb_db, h->key);
-	return 0;
-}
-
-/*
-  force the migration of a record to this node
- */
-static int ctdb_client_force_migration(struct ctdb_db_context *ctdb_db, TDB_DATA key)
-{
-	struct ctdb_call call;
-	ZERO_STRUCT(call);
-	call.call_id = CTDB_NULL_FUNC;
-	call.key = key;
-	call.flags = CTDB_IMMEDIATE_MIGRATION;
-	return ctdb_call(ctdb_db, &call);
-}
-
-/*
-  try to fetch a readonly copy of a record
- */
-static int
-ctdb_client_fetch_readonly(struct ctdb_db_context *ctdb_db, TDB_DATA key, TALLOC_CTX *mem_ctx, struct ctdb_ltdb_header **hdr, TDB_DATA *data)
-{
-	int ret;
-
-	struct ctdb_call call;
-	ZERO_STRUCT(call);
-
-	call.call_id = CTDB_FETCH_WITH_HEADER_FUNC;
-	call.call_data.dptr = NULL;
-	call.call_data.dsize = 0;
-	call.key = key;
-	call.flags = CTDB_WANT_READONLY;
-	ret = ctdb_call(ctdb_db, &call);
-
-	if (ret != 0) {
-		return -1;
-	}
-	if (call.reply_data.dsize < sizeof(struct ctdb_ltdb_header)) {
-		return -1;
-	}
-
-	*hdr = talloc_memdup(mem_ctx, &call.reply_data.dptr[0], sizeof(struct ctdb_ltdb_header));
-	if (*hdr == NULL) {
-		talloc_free(call.reply_data.dptr);
-		return -1;
-	}
-
-	data->dsize = call.reply_data.dsize - sizeof(struct ctdb_ltdb_header);
-	data->dptr  = talloc_memdup(mem_ctx, &call.reply_data.dptr[sizeof(struct ctdb_ltdb_header)], data->dsize);
-	if (data->dptr == NULL) {
-		talloc_free(call.reply_data.dptr);
-		talloc_free(hdr);
-		return -1;
-	}
-
-	return 0;
-}
-
-/*
-  get a lock on a record, and return the records data. Blocks until it gets the lock
- */
-struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, 
-					   TDB_DATA key, TDB_DATA *data)
-{
-	int ret;
-	struct ctdb_record_handle *h;
-
-	/*
-	  procedure is as follows:
-
-	  1) get the chain lock. 
-	  2) check if we are dmaster
-	  3) if we are the dmaster then return handle 
-	  4) if not dmaster then ask ctdb daemon to make us dmaster, and wait for
-	     reply from ctdbd
-	  5) when we get the reply, goto (1)
-	 */
-
-	h = talloc_zero(mem_ctx, struct ctdb_record_handle);
-	if (h == NULL) {
-		return NULL;
-	}
-
-	h->ctdb_db = ctdb_db;
-	h->key     = key;
-	h->key.dptr = talloc_memdup(h, key.dptr, key.dsize);
-	if (h->key.dptr == NULL) {
-		talloc_free(h);
-		return NULL;
-	}
-	h->data    = data;
-
-	DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: key=%*.*s\n", (int)key.dsize, (int)key.dsize, 
-		 (const char *)key.dptr));
-
-again:
-	/* step 1 - get the chain lock */
-	ret = ctdb_ltdb_lock(ctdb_db, key);
-	if (ret != 0) {
-		DEBUG(DEBUG_ERR, (__location__ " failed to lock ltdb record\n"));
-		talloc_free(h);
-		return NULL;
-	}
-
-	DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: got chain lock\n"));
-
-	talloc_set_destructor(h, fetch_lock_destructor);
-
-	ret = ctdb_ltdb_fetch(ctdb_db, key, &h->header, h, data);
-
-	/* when torturing, ensure we test the remote path */
-	if ((ctdb_db->ctdb->flags & CTDB_FLAG_TORTURE) &&
-	    random() % 5 == 0) {
-		h->header.dmaster = (uint32_t)-1;
-	}
-
-
-	DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: done local fetch\n"));
-
-	if (ret != 0 || h->header.dmaster != ctdb_db->ctdb->pnn) {
-		ctdb_ltdb_unlock(ctdb_db, key);
-		ret = ctdb_client_force_migration(ctdb_db, key);
-		if (ret != 0) {
-			DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: force_migration failed\n"));
-			talloc_free(h);
-			return NULL;
-		}
-		goto again;
-	}
-
-	/* if this is a request for read/write and we have delegations
-	   we have to revoke all delegations first
-	*/
-	if ((h->header.dmaster == ctdb_db->ctdb->pnn) &&
-	    (h->header.flags & CTDB_REC_RO_HAVE_DELEGATIONS)) {
-		ctdb_ltdb_unlock(ctdb_db, key);
-		ret = ctdb_client_force_migration(ctdb_db, key);
-		if (ret != 0) {
-			DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
-			talloc_free(h);
-			return NULL;
-		}
-		goto again;
-	}
-
-	DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: we are dmaster - done\n"));
-	return h;
-}
-
-/*
-  get a readonly lock on a record, and return the records data. Blocks until it gets the lock
- */
-struct ctdb_record_handle *
-ctdb_fetch_readonly_lock(
-	struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, 
-	TDB_DATA key, TDB_DATA *data,
-	int read_only)
-{
-	int ret;
-	struct ctdb_record_handle *h;
-	struct ctdb_ltdb_header *roheader = NULL;
-
-	h = talloc_zero(mem_ctx, struct ctdb_record_handle);
-	if (h == NULL) {
-		return NULL;
-	}
-
-	h->ctdb_db = ctdb_db;
-	h->key     = key;
-	h->key.dptr = talloc_memdup(h, key.dptr, key.dsize);
-	if (h->key.dptr == NULL) {
-		talloc_free(h);
-		return NULL;
-	}
-	h->data    = data;
-
-	data->dptr = NULL;
-	data->dsize = 0;
-
-
-again:
-	talloc_free(roheader);
-	roheader = NULL;
-
-	talloc_free(data->dptr);
-	data->dptr = NULL;
-	data->dsize = 0;
-
-	/* Lock the record/chain */
-	ret = ctdb_ltdb_lock(ctdb_db, key);
-	if (ret != 0) {
-		DEBUG(DEBUG_ERR, (__location__ " failed to lock ltdb record\n"));
-		talloc_free(h);
-		return NULL;
-	}
-
-	talloc_set_destructor(h, fetch_lock_destructor);
-
-	/* Check if record exists yet in the TDB */
-	ret = ctdb_ltdb_fetch_with_header(ctdb_db, key, &h->header, h, data);
-	if (ret != 0) {
-		ctdb_ltdb_unlock(ctdb_db, key);
-		ret = ctdb_client_force_migration(ctdb_db, key);
-		if (ret != 0) {
-			DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
-			talloc_free(h);
-			return NULL;
-		}
-		goto again;
-	}
-
-	/* if this is a request for read/write and we have delegations
-	   we have to revoke all delegations first
-	*/
-	if ((read_only == 0) 
-	&&  (h->header.dmaster == ctdb_db->ctdb->pnn)
-	&&  (h->header.flags & CTDB_REC_RO_HAVE_DELEGATIONS)) {
-		ctdb_ltdb_unlock(ctdb_db, key);
-		ret = ctdb_client_force_migration(ctdb_db, key);
-		if (ret != 0) {
-			DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
-			talloc_free(h);
-			return NULL;
-		}
-		goto again;
-	}
-
-	/* if we are dmaster, just return the handle */
-	if (h->header.dmaster == ctdb_db->ctdb->pnn) {
-		return h;
-	}
-
-	if (read_only != 0) {
-		TDB_DATA rodata = {NULL, 0};
-
-		if ((h->header.flags & CTDB_REC_RO_HAVE_READONLY)
-		||  (h->header.flags & CTDB_REC_RO_HAVE_DELEGATIONS)) {
-			return h;
-		}
-
-		ctdb_ltdb_unlock(ctdb_db, key);
-		ret = ctdb_client_fetch_readonly(ctdb_db, key, h, &roheader, &rodata);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR,("ctdb_fetch_readonly_lock:  failed. force migration and try again\n"));
-			ret = ctdb_client_force_migration(ctdb_db, key);
-			if (ret != 0) {
-				DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
-				talloc_free(h);
-				return NULL;
-			}
-
-			goto again;
-		}
-
-		if (!(roheader->flags&CTDB_REC_RO_HAVE_READONLY)) {
-			ret = ctdb_client_force_migration(ctdb_db, key);
-			if (ret != 0) {
-				DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
-				talloc_free(h);
-				return NULL;
-			}
-
-			goto again;
-		}
-
-		ret = ctdb_ltdb_lock(ctdb_db, key);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR, (__location__ " failed to lock ltdb record\n"));
-			talloc_free(h);
-			return NULL;
-		}
-
-		ret = ctdb_ltdb_fetch_with_header(ctdb_db, key, &h->header, h, data);
-		if (ret != 0) {
-			ctdb_ltdb_unlock(ctdb_db, key);
-
-			ret = ctdb_client_force_migration(ctdb_db, key);
-			if (ret != 0) {
-				DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
-				talloc_free(h);
-				return NULL;
-			}
-
-			goto again;
-		}
-
-		return h;
-	}
-
-	/* we are not dmaster and this was not a request for a readonly lock
-	 * so unlock the record, migrate it and try again
-	 */
-	ctdb_ltdb_unlock(ctdb_db, key);
-	ret = ctdb_client_force_migration(ctdb_db, key);
-	if (ret != 0) {
-		DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: force_migration failed\n"));
-		talloc_free(h);
-		return NULL;
-	}
-	goto again;
-}
-
-/*
-  store some data to the record that was locked with ctdb_fetch_lock()
-*/
-int ctdb_record_store(struct ctdb_record_handle *h, TDB_DATA data)
-{
-	if (! ctdb_db_volatile(h->ctdb_db)) {
-		DEBUG(DEBUG_ERR,
-		      ("ctdb_record_store prohibited for non-volatile dbs\n"));
-		return -1;
-	}
-
-	return ctdb_ltdb_store(h->ctdb_db, h->key, &h->header, data);
-}
-
-/*
-  non-locking fetch of a record
- */
-int ctdb_fetch(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, 
-	       TDB_DATA key, TDB_DATA *data)
-{
-	struct ctdb_call call;
-	int ret;
-
-	call.call_id = CTDB_FETCH_FUNC;
-	call.call_data.dptr = NULL;
-	call.call_data.dsize = 0;
-	call.key = key;
-
-	ret = ctdb_call(ctdb_db, &call);
-
-	if (ret == 0) {
-		*data = call.reply_data;
-		talloc_steal(mem_ctx, data->dptr);
-	}
-
-	return ret;
-}
-
-
-
-/*
    called when a control completes or timesout to invoke the callback
    function the user provided
 */
@@ -1210,134 +862,6 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid,
 			errormsg);
 }
 
-
-
-
-/*
-  a process exists call. Returns 0 if process exists, -1 otherwise
- */
-int ctdb_ctrl_process_exists(struct ctdb_context *ctdb, uint32_t destnode, pid_t pid)
-{
-	int ret;
-	TDB_DATA data;
-	int32_t status;
-
-	data.dptr = (uint8_t*)&pid;
-	data.dsize = sizeof(pid);
-
-	ret = ctdb_control(ctdb, destnode, 0, 
-			   CTDB_CONTROL_PROCESS_EXISTS, 0, data, 
-			   NULL, NULL, &status, NULL, NULL);
-	if (ret != 0) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_control for process_exists failed\n"));
-		return -1;
-	}
-
-	return status;
-}
-
-/*
-  get remote statistics
- */
-int ctdb_ctrl_statistics(struct ctdb_context *ctdb, uint32_t destnode, struct ctdb_statistics *status)
-{
-	int ret;
-	TDB_DATA data;
-	int32_t res;
-
-	ret = ctdb_control(ctdb, destnode, 0, 
-			   CTDB_CONTROL_STATISTICS, 0, tdb_null, 
-			   ctdb, &data, &res, NULL, NULL);
-	if (ret != 0 || res != 0) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_control for statistics failed\n"));
-		return -1;
-	}
-
-	if (data.dsize != sizeof(struct ctdb_statistics)) {
-		DEBUG(DEBUG_ERR,(__location__ " Wrong statistics size %u - expected %u\n",
-			 (unsigned)data.dsize, (unsigned)sizeof(struct ctdb_statistics)));
-		      return -1;
-	}
-
-	*status = *(struct ctdb_statistics *)data.dptr;
-	talloc_free(data.dptr);
-			
-	return 0;
-}
-
-/*
- * get db statistics
- */
-int ctdb_ctrl_dbstatistics(struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
-			   TALLOC_CTX *mem_ctx, struct ctdb_db_statistics_old **dbstat)
-{
-	int ret;
-	TDB_DATA indata, outdata;
-	int32_t res;
-	struct ctdb_db_statistics_old *wire, *s;
-	char *ptr;
-	int i;
-
-	indata.dptr = (uint8_t *)&dbid;
-	indata.dsize = sizeof(dbid);
-
-	ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_GET_DB_STATISTICS,
-			   0, indata, ctdb, &outdata, &res, NULL, NULL);
-	if (ret != 0 || res != 0) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_control for dbstatistics failed\n"));
-		return -1;
-	}
-
-	if (outdata.dsize < offsetof(struct ctdb_db_statistics_old, hot_keys_wire)) {
-		DEBUG(DEBUG_ERR,(__location__ " Wrong dbstatistics size %zi - expected >= %lu\n",
-				 outdata.dsize,
-				 (long unsigned int)sizeof(struct ctdb_statistics)));
-		return -1;
-	}
-
-	s = talloc_zero(mem_ctx, struct ctdb_db_statistics_old);
-	if (s == NULL) {
-		talloc_free(outdata.dptr);
-		CTDB_NO_MEMORY(ctdb, s);
-	}
-
-	wire = (struct ctdb_db_statistics_old *)outdata.dptr;
-	memcpy(s, wire, offsetof(struct ctdb_db_statistics_old, hot_keys_wire));
-	ptr = &wire->hot_keys_wire[0];
-	for (i=0; i<wire->num_hot_keys; i++) {
-		s->hot_keys[i].key.dptr = talloc_size(mem_ctx, s->hot_keys[i].key.dsize);
-		if (s->hot_keys[i].key.dptr == NULL) {
-			talloc_free(outdata.dptr);
-			CTDB_NO_MEMORY(ctdb, s->hot_keys[i].key.dptr);
-		}
-
-		memcpy(s->hot_keys[i].key.dptr, ptr, s->hot_keys[i].key.dsize);
-		ptr += wire->hot_keys[i].key.dsize;
-	}
-
-	talloc_free(outdata.dptr);
-	*dbstat = s;
-	return 0;
-}
-
-/*
-  shutdown a remote ctdb node
- */
-int ctdb_ctrl_shutdown(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
-{
-	struct ctdb_client_control_state *state;
-
-	state = ctdb_control_send(ctdb, destnode, 0, 
-			   CTDB_CONTROL_SHUTDOWN, 0, tdb_null, 
-			   NULL, &timeout, NULL);
-	if (state == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " ctdb_control for shutdown failed\n"));
-		return -1;
-	}
-
-	return 0;
-}
-
 /*
   get vnn map from a remote node
  */
@@ -1554,259 +1078,68 @@ int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb,
 	return 0;
 }
 
-/*
-  load nodes file on a remote node and return as a node map


-- 
Samba Shared Repository



More information about the samba-cvs mailing list