summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcli/smb/smb2cli_create.c14
-rw-r--r--libcli/smb/smbXcli_base.h4
-rw-r--r--source3/libsmb/cli_np_tstream.c2
-rw-r--r--source3/torture/test_smb2.c32
4 files changed, 29 insertions, 23 deletions
diff --git a/libcli/smb/smb2cli_create.c b/libcli/smb/smb2cli_create.c
index 29b0396815..33af378f90 100644
--- a/libcli/smb/smb2cli_create.c
+++ b/libcli/smb/smb2cli_create.c
@@ -49,7 +49,7 @@ struct tevent_req *smb2cli_create_send(
struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
const char *filename,
uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
@@ -70,6 +70,7 @@ struct tevent_req *smb2cli_create_send(
size_t blobs_offset;
uint8_t *dyn;
size_t dyn_len;
+ uint32_t tcon_id = 0;
req = tevent_req_create(mem_ctx, &state,
struct smb2cli_create_state);
@@ -137,6 +138,10 @@ struct tevent_req *smb2cli_create_send(
data_blob_free(&blob);
}
+ if (tcon) {
+ tcon_id = smb2cli_tcon_current_id(tcon);
+ }
+
subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_CREATE,
0, 0, /* flags */
timeout_msec,
@@ -231,7 +236,7 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
const char *filename,
uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
@@ -260,8 +265,9 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
if (ev == NULL) {
goto fail;
}
- req = smb2cli_create_send(frame, ev, conn, timeout_msec, session,
- tcon_id, filename, oplock_level,
+ req = smb2cli_create_send(frame, ev, conn, timeout_msec,
+ session, tcon,
+ filename, oplock_level,
impersonation_level, desired_access,
file_attributes, share_access,
create_disposition, create_options,
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index a105c8278b..e65ff144aa 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -322,7 +322,7 @@ struct tevent_req *smb2cli_create_send(
struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
const char *filename,
uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
@@ -338,7 +338,7 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
const char *filename,
uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index 9d5d013f54..7482f9da62 100644
--- a/source3/libsmb/cli_np_tstream.c
+++ b/source3/libsmb/cli_np_tstream.c
@@ -175,7 +175,7 @@ struct tevent_req *tstream_cli_np_open_send(TALLOC_CTX *mem_ctx,
} else {
subreq = smb2cli_create_send(state, ev, cli->conn,
cli->timeout, cli->smb2.session,
- cli->smb2.tid,
+ cli->smb2.tcon,
npipe,
SMB2_OPLOCK_LEVEL_NONE,
SMB2_IMPERSONATION_IMPERSONATION,
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index 86a0e23b79..6177817dae 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -73,7 +73,7 @@ bool run_smb2_basic(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "smb2-basic.txt",
+ 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, */
@@ -133,7 +133,7 @@ bool run_smb2_basic(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "",
+ cli->smb2.tcon, "",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_SYNCHRONIZE|
@@ -323,7 +323,7 @@ bool run_smb2_session_reconnect(int dummy)
}
status = smb2cli_create(cli1->conn, cli1->timeout, cli1->smb2.session,
- cli1->smb2.tid, "session-reconnect.txt",
+ 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, */
@@ -558,7 +558,7 @@ bool run_smb2_session_reconnect(int dummy)
}
status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
- cli2->smb2.tid, "session-reconnect.txt",
+ 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, */
@@ -620,7 +620,7 @@ bool run_smb2_session_reconnect(int dummy)
}
status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
- cli2->smb2.tid, "session-reconnect.txt",
+ 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, */
@@ -647,7 +647,7 @@ bool run_smb2_session_reconnect(int dummy)
}
status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
- cli2->smb2.tid, "session-reconnect.txt",
+ 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, */
@@ -741,7 +741,7 @@ bool run_smb2_tcon_dependence(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "tcon_depedence.txt",
+ 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, */
@@ -1146,7 +1146,7 @@ bool run_smb2_multi_channel(int dummy)
cli3->smb2.tid = cli2->smb2.tid;
status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
- cli2->smb2.tid, "multi-channel.txt",
+ cli2->smb2.tcon, "multi-channel.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
@@ -1306,7 +1306,7 @@ bool run_smb2_multi_channel(int dummy)
}
status = smb2cli_create(cli1->conn, cli1->timeout, cli1->smb2.session,
- cli1->smb2.tid, "multi-channel-invalid.txt",
+ 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, */
@@ -1323,7 +1323,7 @@ bool run_smb2_multi_channel(int dummy)
}
status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
- cli2->smb2.tid, "multi-channel-invalid.txt",
+ cli2->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, */
@@ -1340,7 +1340,7 @@ bool run_smb2_multi_channel(int dummy)
}
status = smb2cli_create(cli3->conn, cli3->timeout, cli3->smb2.session,
- cli3->smb2.tid, "multi-channel-invalid.txt",
+ cli3->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, */
@@ -1471,7 +1471,7 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "session-reauth.txt",
+ 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, */
@@ -1488,7 +1488,7 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "",
+ cli->smb2.tcon, "",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_SYNCHRONIZE|
@@ -1673,7 +1673,7 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "session-reauth-invalid.txt",
+ 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, */
@@ -1690,7 +1690,7 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "",
+ cli->smb2.tcon, "",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_SYNCHRONIZE|
@@ -1837,7 +1837,7 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, "session-reauth.txt",
+ 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, */