summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcli/smb/smb2cli_close.c11
-rw-r--r--libcli/smb/smbXcli_base.h4
-rw-r--r--source3/libsmb/cli_np_tstream.c9
-rw-r--r--source3/torture/test_smb2.c12
4 files changed, 21 insertions, 15 deletions
diff --git a/libcli/smb/smb2cli_close.c b/libcli/smb/smb2cli_close.c
index d4cba41416..42ed65a5de 100644
--- a/libcli/smb/smb2cli_close.c
+++ b/libcli/smb/smb2cli_close.c
@@ -34,7 +34,7 @@ struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint16_t flags,
uint64_t fid_persistent,
uint64_t fid_volatile)
@@ -42,6 +42,7 @@ struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req, *subreq;
struct smb2cli_close_state *state;
uint8_t *fixed;
+ uint32_t tcon_id = 0;
req = tevent_req_create(mem_ctx, &state,
struct smb2cli_close_state);
@@ -54,6 +55,10 @@ struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
SBVAL(fixed, 8, fid_persistent);
SBVAL(fixed, 16, fid_volatile);
+ if (tcon) {
+ tcon_id = smb2cli_tcon_current_id(tcon);
+ }
+
subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_CLOSE,
0, 0, /* flags */
timeout_msec,
@@ -98,7 +103,7 @@ NTSTATUS smb2cli_close_recv(struct tevent_req *req)
NTSTATUS smb2cli_close(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint16_t flags,
uint64_t fid_persistent,
uint64_t fid_volatile)
@@ -120,7 +125,7 @@ NTSTATUS smb2cli_close(struct smbXcli_conn *conn,
goto fail;
}
req = smb2cli_close_send(frame, ev, conn, timeout_msec,
- session, tcon_id, flags,
+ session, tcon, flags,
fid_persistent, fid_volatile);
if (req == NULL) {
goto fail;
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index e65ff144aa..b433c4e769 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -356,7 +356,7 @@ struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint16_t flags,
uint64_t fid_persistent,
uint64_t fid_volatile);
@@ -364,7 +364,7 @@ NTSTATUS smb2cli_close_recv(struct tevent_req *req);
NTSTATUS smb2cli_close(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint16_t flags,
uint64_t fid_persistent,
uint64_t fid_volatile);
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index 7482f9da62..47333868dc 100644
--- a/source3/libsmb/cli_np_tstream.c
+++ b/source3/libsmb/cli_np_tstream.c
@@ -99,7 +99,8 @@ static int tstream_cli_np_destructor(struct tstream_cli_np *cli_nps)
status = smb2cli_close(cli_nps->cli->conn,
cli_nps->cli->timeout,
cli_nps->cli->smb2.session,
- cli_nps->cli->smb2.tid, 0,
+ cli_nps->cli->smb2.tcon,
+ 0, /* flags */
cli_nps->fid_persistent,
cli_nps->fid_volatile);
}
@@ -574,7 +575,7 @@ static void tstream_cli_np_writev_disconnect_now(struct tevent_req *req,
cli_nps->cli->conn,
cli_nps->cli->timeout,
cli_nps->cli->smb2.session,
- cli_nps->cli->smb2.tid,
+ cli_nps->cli->smb2.tcon,
0, /* flags */
cli_nps->fid_persistent,
cli_nps->fid_volatile);
@@ -1036,7 +1037,7 @@ static void tstream_cli_np_readv_disconnect_now(struct tevent_req *req,
cli_nps->cli->conn,
cli_nps->cli->timeout,
cli_nps->cli->smb2.session,
- cli_nps->cli->smb2.tid,
+ cli_nps->cli->smb2.tcon,
0, /* flags */
cli_nps->fid_persistent,
cli_nps->fid_volatile);
@@ -1172,7 +1173,7 @@ static struct tevent_req *tstream_cli_np_disconnect_send(TALLOC_CTX *mem_ctx,
subreq = smb2cli_close_send(state, ev, cli_nps->cli->conn,
cli_nps->cli->timeout,
cli_nps->cli->smb2.session,
- cli_nps->cli->smb2.tid,
+ cli_nps->cli->smb2.tcon,
0, /* flags */
cli_nps->fid_persistent,
cli_nps->fid_volatile);
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index 6177817dae..a4655dc05d 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -126,7 +126,7 @@ bool run_smb2_basic(int dummy)
}
status = smb2cli_close(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, 0, fid_persistent, fid_volatile);
+ cli->smb2.tcon, 0, fid_persistent, fid_volatile);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_close returned %s\n", nt_errstr(status));
return false;
@@ -162,7 +162,7 @@ bool run_smb2_basic(int dummy)
}
status = smb2cli_close(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, 0, fid_persistent, fid_volatile);
+ cli->smb2.tcon, 0, fid_persistent, fid_volatile);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_close returned %s\n", nt_errstr(status));
return false;
@@ -1385,7 +1385,7 @@ bool run_smb2_multi_channel(int dummy)
}
status = smb2cli_close(cli3->conn, cli3->timeout, cli3->smb2.session,
- cli3->smb2.tid, 0, fid_persistent, fid_volatile);
+ cli3->smb2.tcon, 0, fid_persistent, fid_volatile);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_close returned %s\n", nt_errstr(status));
return false;
@@ -1830,7 +1830,7 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_close(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, 0, fid_persistent, fid_volatile);
+ cli->smb2.tcon, 0, fid_persistent, fid_volatile);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_close returned %s\n", nt_errstr(status));
return false;
@@ -1864,14 +1864,14 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_close(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, 0, dir_persistent, dir_volatile);
+ cli->smb2.tcon, 0, dir_persistent, dir_volatile);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_close returned %s\n", nt_errstr(status));
return false;
}
status = smb2cli_close(cli->conn, cli->timeout, cli->smb2.session,
- cli->smb2.tid, 0, fid_persistent, fid_volatile);
+ cli->smb2.tcon, 0, fid_persistent, fid_volatile);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_close returned %s\n", nt_errstr(status));
return false;