libsmb: Return symlink error struct from smb2cli_create_recv()
authorVolker Lendecke <vl@samba.org>
Mon, 25 Oct 2021 13:23:43 +0000 (15:23 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 22 Nov 2022 18:27:33 +0000 (18:27 +0000)
Looks larger than it is, this just adds a parameter and while there
adapts long lines to README.Coding

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
examples/fuse/clifuse.c
libcli/smb/smb2cli_create.c
libcli/smb/smbXcli_base.h
libcli/smb/tstream_smbXcli_np.c
source3/libsmb/cli_smb2_fnum.c
source3/torture/test_smb2.c

index f75a9f5a2d792858614e713d558a47804a651ab9..721b282baf0e72e40426185f8c88a48e588e100b 100644 (file)
@@ -267,8 +267,14 @@ static void cli_get_unixattr_opened(struct tevent_req *subreq)
        struct cli_state *cli = state->cli;
        NTSTATUS status;
 
-       status = smb2cli_create_recv(subreq, &state->fid_persistent,
-                                    &state->fid_volatile, NULL, NULL, NULL);
+       status = smb2cli_create_recv(
+               subreq,
+               &state->fid_persistent,
+               &state->fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        TALLOC_FREE(subreq);
        if (tevent_req_nterror(req, status)) {
                DBG_DEBUG("smb2cli_create_recv returned %s\n",
@@ -1174,10 +1180,14 @@ static void cli_ll_opendir_done(struct tevent_req *req)
                req, struct ll_opendir_state);
        NTSTATUS status;
 
-       status = smb2cli_create_recv(req,
-                                    &state->dir_state->fid_persistent,
-                                    &state->dir_state->fid_volatile,
-                                    NULL, NULL, NULL);
+       status = smb2cli_create_recv(
+               req,
+               &state->dir_state->fid_persistent,
+               &state->dir_state->fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        TALLOC_FREE(req);
 
        DEBUG(10, ("%s: smbcli_create_recv returned %s\n", __func__,
index 6417de6332dea16d41a9cac1977b953f14133c96..596acb3d9a7980cb9ecd530bbf8860eb3f0e5fc5 100644 (file)
@@ -336,6 +336,11 @@ static NTSTATUS smb2cli_create_unparsed_unix_len(
                return NT_STATUS_INVALID_NETWORK_RESPONSE;
        }
 
+       if (unparsed_utf16_len == 0) {
+               *_unparsed_unix_len = 0;
+               return NT_STATUS_OK;
+       }
+
        unparsed_utf16 = name_utf16 + name_utf16_len - unparsed_utf16_len;
 
        ok = convert_string_talloc(
@@ -352,16 +357,7 @@ static NTSTATUS smb2cli_create_unparsed_unix_len(
                          strerror(errno));
                return status;
        }
-
-       /*
-        * convert_string_talloc() returns a 0-terminated string
-        */
-       SMB_ASSERT(unparsed_unix_len > 0);
-       SMB_ASSERT(unparsed_unix[unparsed_unix_len-1] == '\0');
-
-       TALLOC_FREE(unparsed_unix);
-
-       *_unparsed_unix_len = (unparsed_unix_len-1);
+       *_unparsed_unix_len = unparsed_unix_len;
        return NT_STATUS_OK;
 }
 
@@ -469,7 +465,8 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
                             uint64_t *fid_volatile,
                             struct smb_create_returns *cr,
                             TALLOC_CTX *mem_ctx,
-                            struct smb2_create_blobs *blobs)
+                            struct smb2_create_blobs *blobs,
+                            struct symlink_reparse_struct **psymlink)
 {
        struct smb2cli_create_state *state =
                tevent_req_data(req,
@@ -477,6 +474,10 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
        NTSTATUS status;
 
        if (tevent_req_is_nterror(req, &status)) {
+               if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK) &&
+                   (psymlink != NULL)) {
+                       *psymlink = talloc_move(mem_ctx, &state->symlink);
+               }
                tevent_req_received(req);
                return status;
        }
@@ -510,7 +511,8 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
                        uint64_t *fid_volatile,
                        struct smb_create_returns *cr,
                        TALLOC_CTX *mem_ctx,
-                       struct smb2_create_blobs *ret_blobs)
+                       struct smb2_create_blobs *ret_blobs,
+                       struct symlink_reparse_struct **psymlink)
 {
        TALLOC_CTX *frame = talloc_stackframe();
        struct tevent_context *ev;
@@ -541,8 +543,14 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
        if (!tevent_req_poll_ntstatus(req, ev, &status)) {
                goto fail;
        }
-       status = smb2cli_create_recv(req, fid_persistent, fid_volatile, cr,
-                                    mem_ctx, ret_blobs);
+       status = smb2cli_create_recv(
+               req,
+               fid_persistent,
+               fid_volatile,
+               cr,
+               mem_ctx,
+               ret_blobs,
+               psymlink);
  fail:
        TALLOC_FREE(frame);
        return status;
index 8d2e6b3e204114fa953918164ca03c6796b2c7ac..bf8638711ba58bf78a4e425ed80bb6d449d1dbe4 100644 (file)
@@ -647,6 +647,8 @@ NTSTATUS smb2cli_tdis(struct smbXcli_conn *conn,
                      struct smbXcli_session *session,
                      struct smbXcli_tcon *tcon);
 
+struct symlink_reparse_struct;
+
 struct tevent_req *smb2cli_create_send(
        TALLOC_CTX *mem_ctx,
        struct tevent_context *ev,
@@ -668,7 +670,8 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
                             uint64_t *fid_volatile,
                             struct smb_create_returns *cr,
                             TALLOC_CTX *mem_ctx,
-                            struct smb2_create_blobs *blobs);
+                            struct smb2_create_blobs *blobs,
+                            struct symlink_reparse_struct **psymlink);
 NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
                        uint32_t timeout_msec,
                        struct smbXcli_session *session,
@@ -686,7 +689,8 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
                        uint64_t *fid_volatile,
                        struct smb_create_returns *cr,
                        TALLOC_CTX *mem_ctx,
-                       struct smb2_create_blobs *ret_blobs);
+                       struct smb2_create_blobs *ret_blobs,
+                       struct symlink_reparse_struct **psymlink);
 
 struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
                                      struct tevent_context *ev,
index 8dfc4fb2466a1ad1b1879c9a92d64c1a37c93b50..ef685e16f4f473376e064cbf4e8b066b69db3c77 100644 (file)
@@ -280,10 +280,14 @@ static void tstream_smbXcli_np_open_done(struct tevent_req *subreq)
        if (state->is_smb1) {
                status = smb1cli_ntcreatex_recv(subreq, &state->fnum);
        } else {
-               status = smb2cli_create_recv(subreq,
-                                            &state->fid_persistent,
-                                            &state->fid_volatile,
-                                            NULL, NULL, NULL);
+               status = smb2cli_create_recv(
+                       subreq,
+                       &state->fid_persistent,
+                       &state->fid_volatile,
+                       NULL,
+                       NULL,
+                       NULL,
+                       NULL);
        }
        TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
index 7865b8722bde932bf963add95afe45969263210f..0f753f61d85696953e04c1ac899b6b175732d680 100644 (file)
@@ -343,7 +343,8 @@ static void cli_smb2_create_fnum_done(struct tevent_req *subreq)
                &h.fid_persistent,
                &h.fid_volatile, &state->cr,
                state,
-               &state->out_cblobs);
+               &state->out_cblobs,
+               NULL);
        TALLOC_FREE(subreq);
        if (tevent_req_nterror(req, status)) {
                return;
index 01664b143902068e0ecfea5682dbf6f3a4390233..22918d39ccdc78210d3e83cfae550d4136223d15 100644 (file)
@@ -74,19 +74,28 @@ bool run_smb2_basic(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "smb2-basic.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "smb2-basic.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create returned %s\n", nt_errstr(status));
                return false;
@@ -135,21 +144,31 @@ bool run_smb2_basic(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create returned %s\n", nt_errstr(status));
                return false;
@@ -358,19 +377,28 @@ bool run_smb2_session_reconnect(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli1->conn, cli1->timeout, cli1->smb2.session,
-                       cli1->smb2.tcon, "session-reconnect.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli1->conn,
+               cli1->timeout,
+               cli1->smb2.session,
+               cli1->smb2.tcon,
+               "session-reconnect.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create on cli1 %s\n", nt_errstr(status));
                return false;
@@ -584,19 +612,28 @@ bool run_smb2_session_reconnect(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
-                       cli2->smb2.tcon, "session-reconnect.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli2->conn,
+               cli2->timeout,
+               cli2->smb2.session,
+               cli2->smb2.tcon,
+               "session-reconnect.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) &&
            !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) {
                printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
@@ -645,19 +682,28 @@ bool run_smb2_session_reconnect(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
-                       cli1->smb2.tcon, "session-reconnect.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli2->conn,
+               cli2->timeout,
+               cli2->smb2.session,
+               cli1->smb2.tcon,
+               "session-reconnect.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED) &&
            !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED))
        {
@@ -673,19 +719,28 @@ bool run_smb2_session_reconnect(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
-                       cli2->smb2.tcon, "session-reconnect.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli2->conn,
+               cli2->timeout,
+               cli2->smb2.session,
+               cli2->smb2.tcon,
+               "session-reconnect.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
                return false;
@@ -766,19 +821,28 @@ bool run_smb2_tcon_dependence(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "tcon_depedence.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "tcon_depedence.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create on cli %s\n", nt_errstr(status));
                return false;
@@ -1158,19 +1222,28 @@ bool run_smb2_multi_channel(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
-                       cli1->smb2.tcon, "multi-channel.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli2->conn,
+               cli2->timeout,
+               cli2->smb2.session,
+               cli1->smb2.tcon,
+               "multi-channel.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
                return false;
@@ -1310,55 +1383,82 @@ bool run_smb2_multi_channel(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli1->conn, cli1->timeout, cli1->smb2.session,
-                       cli1->smb2.tcon, "multi-channel-invalid.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli1->conn,
+               cli1->timeout,
+               cli1->smb2.session,
+               cli1->smb2.tcon,
+               "multi-channel-invalid.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
                printf("smb2cli_create %s\n", nt_errstr(status));
                return false;
        }
 
-       status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
-                       cli1->smb2.tcon, "multi-channel-invalid.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli2->conn,
+               cli2->timeout,
+               cli2->smb2.session,
+               cli1->smb2.tcon,
+               "multi-channel-invalid.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
                printf("smb2cli_create %s\n", nt_errstr(status));
                return false;
        }
 
-       status = smb2cli_create(cli3->conn, cli3->timeout, cli3->smb2.session,
-                       cli1->smb2.tcon, "multi-channel-invalid.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli3->conn,
+               cli3->timeout,
+               cli3->smb2.session,
+               cli1->smb2.tcon,
+               "multi-channel-invalid.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
                printf("smb2cli_create %s\n", nt_errstr(status));
                return false;
@@ -1475,39 +1575,58 @@ bool run_smb2_session_reauth(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "session-reauth.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "session-reauth.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create %s\n", nt_errstr(status));
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &dir_persistent,
-                       &dir_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &dir_persistent,
+               &dir_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create returned %s\n", nt_errstr(status));
                return false;
@@ -1670,39 +1789,58 @@ bool run_smb2_session_reauth(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "session-reauth-invalid.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "session-reauth-invalid.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
                printf("smb2cli_create %s\n", nt_errstr(status));
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &dir_persistent,
-                       &dir_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &dir_persistent,
+               &dir_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
                printf("smb2cli_create returned %s\n", nt_errstr(status));
                return false;
@@ -1846,19 +1984,28 @@ bool run_smb2_session_reauth(int dummy)
                return false;
        }
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, "session-reauth.txt",
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
-                       FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DELETE_ON_CLOSE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               "session-reauth.txt",
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
+               FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DELETE_ON_CLOSE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create %s\n", nt_errstr(status));
                return false;
@@ -2075,21 +2222,31 @@ static bool test_dir_fsync(struct cli_state *cli, const char *path)
        uint32_t dir_data_length = 0;
 
        /* Open directory - no write abilities. */
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, path,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               path,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create '%s' (readonly) returned %s\n",
                        path,
@@ -2127,22 +2284,32 @@ static bool test_dir_fsync(struct cli_state *cli, const char *path)
 
        /* Open directory write-attributes only. Flush should still fail. */
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, path,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_WRITE_ATTRIBUTE|
-                       SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               path,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_WRITE_ATTRIBUTE|
+               SEC_DIR_READ_ATTRIBUTE, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create '%s' (write attr) returned %s\n",
                        path,
@@ -2178,21 +2345,31 @@ static bool test_dir_fsync(struct cli_state *cli, const char *path)
 
        /* Open directory with SEC_DIR_ADD_FILE access. Flush should now succeed. */
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, path,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_ADD_FILE, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               path,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_ADD_FILE, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create '%s' (write FILE access) returned %s\n",
                        path,
@@ -2227,21 +2404,31 @@ static bool test_dir_fsync(struct cli_state *cli, const char *path)
 
        /* Open directory with SEC_DIR_ADD_FILE access. Flush should now succeed. */
 
-       status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
-                       cli->smb2.tcon, path,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       SEC_STD_SYNCHRONIZE|
-                       SEC_DIR_LIST|
-                       SEC_DIR_ADD_SUBDIR, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_OPEN, /* create_disposition, */
-                       FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               path,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               SEC_STD_SYNCHRONIZE|
+               SEC_DIR_LIST|
+               SEC_DIR_ADD_SUBDIR, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_OPEN, /* create_disposition, */
+               FILE_SYNCHRONOUS_IO_NONALERT|
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("smb2cli_create '%s' (write DIR access) returned %s\n",
                        path,
@@ -2379,22 +2566,28 @@ bool run_smb2_path_slash(int dummy)
        (void)cli_rmdir(cli, fname_noslash);
 
        /* Try to create a directory with the backslash name. */
-       status = smb2cli_create(cli->conn,
-                       cli->timeout,
-                       cli->smb2.session,
-                       cli->smb2.tcon,
-                       dname_backslash,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               dname_backslash,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
 
        /* directory ending in '\\' should be success. */
 
@@ -2420,22 +2613,28 @@ bool run_smb2_path_slash(int dummy)
        (void)cli_rmdir(cli, dname_noslash);
 
        /* Try to create a directory with the slash name. */
-       status = smb2cli_create(cli->conn,
-                       cli->timeout,
-                       cli->smb2.session,
-                       cli->smb2.tcon,
-                       dname_slash,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               dname_slash,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
 
        /* directory ending in '/' is an error. */
        if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_INVALID)) {
@@ -2459,22 +2658,28 @@ bool run_smb2_path_slash(int dummy)
        (void)cli_rmdir(cli, dname_noslash);
 
        /* Try to create a file with the backslash name. */
-       status = smb2cli_create(cli->conn,
-                       cli->timeout,
-                       cli->smb2.session,
-                       cli->smb2.tcon,
-                       fname_backslash,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_NON_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               fname_backslash,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_NON_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
 
        /* file ending in '\\' should be error. */
 
@@ -2499,22 +2704,28 @@ bool run_smb2_path_slash(int dummy)
        (void)cli_unlink(cli, fname_noslash, 0);
 
        /* Try to create a file with the slash name. */
-       status = smb2cli_create(cli->conn,
-                       cli->timeout,
-                       cli->smb2.session,
-                       cli->smb2.tcon,
-                       fname_slash,
-                       SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
-                       SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
-                       FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
-                       0, /* file_attributes, */
-                       FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
-                       FILE_CREATE, /* create_disposition, */
-                       FILE_NON_DIRECTORY_FILE, /* create_options, */
-                       NULL, /* smb2_create_blobs *blobs */
-                       &fid_persistent,
-                       &fid_volatile,
-                       NULL, NULL, NULL);
+       status = smb2cli_create(
+               cli->conn,
+               cli->timeout,
+               cli->smb2.session,
+               cli->smb2.tcon,
+               fname_slash,
+               SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+               SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+               FILE_READ_DATA|FILE_READ_ATTRIBUTES, /* desired_access, */
+               0, /* file_attributes, */
+               FILE_SHARE_READ|
+               FILE_SHARE_WRITE|
+               FILE_SHARE_DELETE, /* share_access, */
+               FILE_CREATE, /* create_disposition, */
+               FILE_NON_DIRECTORY_FILE, /* create_options, */
+               NULL, /* smb2_create_blobs *blobs */
+               &fid_persistent,
+               &fid_volatile,
+               NULL,
+               NULL,
+               NULL,
+               NULL);
 
        /* file ending in '/' should be error. */
 
@@ -3640,7 +3851,8 @@ static NTSTATUS get_smb2_inode(struct cli_state *cli,
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs * */
+                               NULL); /* struct symlink_reparse_struct */
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -3746,7 +3958,8 @@ static NTSTATUS smb2_dfs_delete(struct cli_state *cli,
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs * */
+                               NULL); /* struct symlink_reparse_struct */
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -4206,7 +4419,8 @@ bool run_smb2_dfs_paths(int dummy)
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs * */
+                               NULL); /* struct symlink_reparse_struct */
        if (!NT_STATUS_IS_OK(status)) {
                printf("%s:%d smb2cli_create on %s returned %s\n",
                        __FILE__,
@@ -4462,7 +4676,8 @@ bool run_smb2_non_dfs_share(int dummy)
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs */
+                               NULL); /* struct symlink_reparse_struct */
        /*
         * Should fail with NT_STATUS_OBJECT_PATH_NOT_FOUND, as
         * even though we set the FLAGS2_DFS_PATHNAMES the server
@@ -4503,7 +4718,8 @@ bool run_smb2_non_dfs_share(int dummy)
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs * */
+                               NULL); /* struct symlink_reparse_struct */
        if (!NT_STATUS_IS_OK(status)) {
                printf("%s:%d smb2cli_create on %s returned %s\n",
                        __FILE__,
@@ -4625,7 +4841,8 @@ bool run_smb2_dfs_share_non_dfs_path(int dummy)
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs * */
+                               NULL); /* psymlink */
        if (!NT_STATUS_IS_OK(status)) {
                printf("%s:%d smb2cli_create on %s returned %s\n",
                        __FILE__,
@@ -4685,7 +4902,8 @@ bool run_smb2_dfs_share_non_dfs_path(int dummy)
                                &fid_volatile,
                                NULL, /* struct smb_create_returns * */
                                talloc_tos(), /* mem_ctx. */
-                               NULL); /* struct smb2_create_blobs * */
+                               NULL, /* struct smb2_create_blobs * */
+                               NULL); /* psymlink */
        if (!NT_STATUS_IS_OK(status)) {
                printf("%s:%d smb2cli_create on %s returned %s\n",
                        __FILE__,