[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Wed Feb 22 09:33:03 MST 2012


The branch, master has been updated
       via  ee2e3d5 s3-vfstest: Fake smb_requests
       via  b0c21af s3-vfstest: Initialize some more
       via  db17767 s3: Add an error msg when a share mode entry is discarded
      from  77889f6 s4:torture:smb2: add a durable-open.open-oplock test

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ee2e3d56a2a633cecf4d1b06badc6fb8fd12580e
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Feb 20 16:28:14 2012 +0100

    s3-vfstest: Fake smb_requests
    
    Autobuild-User: Volker Lendecke <vl at samba.org>
    Autobuild-Date: Wed Feb 22 17:32:28 CET 2012 on sn-devel-104

commit b0c21afffe36b2239f9e688678b28cb58834fb6e
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Feb 20 16:27:07 2012 +0100

    s3-vfstest: Initialize some more

commit db17767d4d1e7ddccab899346d0374095389e370
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Feb 20 16:00:50 2012 +0100

    s3: Add an error msg when a share mode entry is discarded

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

Summary of changes:
 source3/locking/share_mode_lock.c |    2 ++
 source3/torture/vfstest.c         |   28 ++++++++++++++++++++++++++++
 source3/torture/vfstest.h         |    4 ++++
 3 files changed, 34 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 2152591..de8cc3c 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -176,6 +176,8 @@ static struct share_mode_data *parse_share_modes(TALLOC_CTX *mem_ctx,
 	while (i < d->num_share_modes) {
 		struct share_mode_entry *e = &d->share_modes[i];
 		if (!pid_exists[i]) {
+			DEBUG(10, ("wipe non-existent pid %s\n",
+				   procid_str_static(&e->pid)));
 			*e = d->share_modes[d->num_share_modes-1];
 			d->num_share_modes -= 1;
 			d->modified = True;
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 55321dd..53b5ee9 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -32,6 +32,7 @@
 #include "auth.h"
 #include "serverid.h"
 #include "messages.h"
+#include "libcli/security/security.h"
 
 /* List to hold groups of commands */
 static struct cmd_list {
@@ -415,6 +416,30 @@ void exit_server_cleanly(const char *const reason)
 	exit_server("normal exit");
 }
 
+struct smb_request *vfstest_get_smbreq(TALLOC_CTX *mem_ctx,
+				       struct vfs_state *vfs)
+{
+	struct smb_request *result;
+
+	result = talloc_zero(mem_ctx, struct smb_request);
+	if (result == NULL) {
+		return NULL;
+	}
+	result->sconn = vfs->conn->sconn;
+	result->mid = ++vfs->mid;
+
+	result->inbuf = talloc_array(result, uint8_t, smb_size);
+	if (result->inbuf == NULL) {
+		goto fail;
+	}
+	SSVAL(result->inbuf, smb_mid, result->mid);
+	smb_setlen(result->inbuf, smb_size-4);
+	return result;
+fail:
+	TALLOC_FREE(result);
+	return NULL;
+}
+
 /* Main function */
 
 int main(int argc, char *argv[])
@@ -476,9 +501,12 @@ int main(int argc, char *argv[])
 	locking_init();
 	serverid_parent_init(NULL);
 	vfs.conn = talloc_zero(NULL, connection_struct);
+	vfs.conn->share_access = FILE_GENERIC_ALL;
 	vfs.conn->params = talloc_zero(vfs.conn, struct share_params);
 	vfs.conn->sconn = talloc_zero(NULL, struct smbd_server_connection);
 	vfs.conn->sconn->msg_ctx = messaging_init(vfs.conn->sconn, ev);
+	vfs.conn->sconn->ev_ctx = ev;
+	serverid_register(messaging_server_id(vfs.conn->sconn->msg_ctx), 0);
 	make_session_info_guest(NULL, &vfs.conn->session_info);
 	file_init(vfs.conn->sconn);
 	set_conn_connectpath(vfs.conn, getcwd(cwd, sizeof(cwd)));
diff --git a/source3/torture/vfstest.h b/source3/torture/vfstest.h
index 0d71fac..0c57d56 100644
--- a/source3/torture/vfstest.h
+++ b/source3/torture/vfstest.h
@@ -29,12 +29,16 @@ struct func_entry {
 
 struct vfs_state {
 	struct connection_struct *conn;
+	uint64_t mid;
 	struct files_struct *files[1024];
 	DIR *currentdir;
 	void *data;
 	size_t data_size;
 };
 
+struct smb_request *vfstest_get_smbreq(TALLOC_CTX *mem_ctx,
+				       struct vfs_state *vfs);
+
 struct cmd_set {
 	const char *name;
 	NTSTATUS (*fn)(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list