vfstest: make use of create_conn_struct_tos()
authorStefan Metzmacher <metze@samba.org>
Fri, 25 May 2018 06:49:29 +0000 (08:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jun 2018 18:52:23 +0000 (20:52 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/vfstest.c

index 17c19012384af3f3ea54346d397a2ed5f15bba4c..e17e6fc5c347191c07fc75cf70d6bd438f7caf6d 100644 (file)
@@ -460,12 +460,12 @@ int main(int argc, const char *argv[])
 {
        char *cmdstr = NULL;
        struct cmd_set  **cmd_set;
+       struct conn_struct_tos *c = NULL;
        struct vfs_state *vfs;
        int i;
        char *filename = NULL;
        char cwd[MAXPATHLEN];
        TALLOC_CTX *frame = talloc_stackframe();
-       struct tevent_context *ev;
        struct auth_session_info *session_info = NULL;
        NTSTATUS status = NT_STATUS_OK;
 
@@ -527,7 +527,7 @@ int main(int argc, const char *argv[])
        sec_init();
        init_guest_session_info(frame);
        locking_init();
-       vfs = talloc_zero(NULL, struct vfs_state);
+       vfs = talloc_zero(frame, struct vfs_state);
        if (vfs == NULL) {
                return 1;
        }
@@ -536,18 +536,15 @@ int main(int argc, const char *argv[])
                return 1;
        }
 
-       ev = server_event_context();
-
-       status = create_conn_struct(vfs,
-                               ev,
-                               server_messaging_context(),
-                                &vfs->conn,
-                                -1,
-                                getcwd(cwd, sizeof(cwd)),
-                                session_info);
+       status = create_conn_struct_tos(server_messaging_context(),
+                                       -1,
+                                       getcwd(cwd, sizeof(cwd)),
+                                       session_info,
+                                       &c);
        if (!NT_STATUS_IS_OK(status)) {
                return 1;
        }
+       vfs->conn = c->conn;
 
        vfs->conn->share_access = FILE_GENERIC_ALL;
        vfs->conn->read_only = false;