summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-01-08 14:18:55 -0800
committerAndrew Bartlett <abartlet@samba.org>2013-01-09 14:54:31 +1100
commit5bffdac4ed3fa5477e025e871efff759aa0ee8d8 (patch)
tree63aa028c27043e8801572d381c30b6c6d1db5b32 /source3
parent7ba685090487410270415d3e4d69f62947ce34c3 (diff)
downloadsamba-5bffdac4ed3fa5477e025e871efff759aa0ee8d8.tar.gz
samba-5bffdac4ed3fa5477e025e871efff759aa0ee8d8.tar.bz2
samba-5bffdac4ed3fa5477e025e871efff759aa0ee8d8.zip
torture/vfstest.c: Always use create_conn_struct(). Don't hand create connection structs.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/vfstest.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index dd3787b658..de7e732e58 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -454,6 +454,7 @@ int main(int argc, char *argv[])
char cwd[MAXPATHLEN];
TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev = tevent_context_init(NULL);
+ struct auth_session_info *session_info = NULL;
NTSTATUS status = NT_STATUS_OK;
/* make sure the vars that get altered (4th field) are in
@@ -515,22 +516,33 @@ int main(int argc, char *argv[])
locking_init();
serverid_parent_init(NULL);
vfs = talloc_zero(NULL, struct vfs_state);
- vfs->conn = talloc_zero(vfs, connection_struct);
+ if (vfs == NULL) {
+ return 1;
+ }
+ status = make_session_info_guest(vfs, &session_info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return 1;
+ }
+
+ status = create_conn_struct(vfs,
+ ev,
+ messaging_init(vfs, ev),
+ &vfs->conn,
+ -1,
+ getcwd(cwd, sizeof(cwd)),
+ session_info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return 1;
+ }
+
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;
+ vfs->conn->read_only = false;
+
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)));
for (i=0; i < 1024; i++)
vfs->files[i] = NULL;
- /* some advanced initialization stuff */
- smbd_vfs_init(vfs->conn);
-
if (!posix_locking_init(false)) {
return 1;
}