mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
libcli/smb: pass smbXcli_tcon to smb2cli_write*()
metze
This commit is contained in:
parent
697b82a619
commit
86a5ab731b
@ -35,7 +35,7 @@ struct tevent_req *smb2cli_write_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,
|
||||
uint32_t length,
|
||||
uint64_t offset,
|
||||
uint64_t fid_persistent,
|
||||
@ -49,6 +49,7 @@ struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx,
|
||||
uint8_t *fixed;
|
||||
const uint8_t *dyn;
|
||||
size_t dyn_len;
|
||||
uint32_t tcon_id = 0;
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state,
|
||||
struct smb2cli_write_state);
|
||||
@ -75,6 +76,10 @@ struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx,
|
||||
dyn_len = sizeof(state->dyn_pad);
|
||||
}
|
||||
|
||||
if (tcon) {
|
||||
tcon_id = smb2cli_tcon_current_id(tcon);
|
||||
}
|
||||
|
||||
subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_WRITE,
|
||||
0, 0, /* flags */
|
||||
timeout_msec,
|
||||
@ -119,7 +124,7 @@ NTSTATUS smb2cli_write_recv(struct tevent_req *req)
|
||||
NTSTATUS smb2cli_write(struct smbXcli_conn *conn,
|
||||
uint32_t timeout_msec,
|
||||
struct smbXcli_session *session,
|
||||
uint32_t tcon_id,
|
||||
struct smbXcli_tcon *tcon,
|
||||
uint32_t length,
|
||||
uint64_t offset,
|
||||
uint64_t fid_persistent,
|
||||
@ -144,8 +149,9 @@ NTSTATUS smb2cli_write(struct smbXcli_conn *conn,
|
||||
if (ev == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
req = smb2cli_write_send(frame, ev, conn, timeout_msec, session,
|
||||
tcon_id, length, offset,
|
||||
req = smb2cli_write_send(frame, ev, conn, timeout_msec,
|
||||
session, tcon,
|
||||
length, offset,
|
||||
fid_persistent, fid_volatile,
|
||||
remaining_bytes, flags, data);
|
||||
if (req == NULL) {
|
||||
|
@ -402,7 +402,7 @@ struct tevent_req *smb2cli_write_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,
|
||||
uint32_t length,
|
||||
uint64_t offset,
|
||||
uint64_t fid_persistent,
|
||||
@ -414,7 +414,7 @@ NTSTATUS smb2cli_write_recv(struct tevent_req *req);
|
||||
NTSTATUS smb2cli_write(struct smbXcli_conn *conn,
|
||||
uint32_t timeout_msec,
|
||||
struct smbXcli_session *session,
|
||||
uint32_t tcon_id,
|
||||
struct smbXcli_tcon *tcon,
|
||||
uint32_t length,
|
||||
uint64_t offset,
|
||||
uint64_t fid_persistent,
|
||||
|
@ -491,7 +491,7 @@ static void tstream_cli_np_writev_write_next(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,
|
||||
cli_nps->write.ofs, /* length */
|
||||
0, /* offset */
|
||||
cli_nps->fid_persistent,
|
||||
|
@ -90,7 +90,7 @@ bool run_smb2_basic(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli->conn, cli->timeout, cli->smb2.session,
|
||||
cli->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("smb2cli_write returned %s\n", nt_errstr(status));
|
||||
@ -340,7 +340,7 @@ bool run_smb2_session_reconnect(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli1->conn, cli1->timeout, cli1->smb2.session,
|
||||
cli1->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli1->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("smb2cli_write returned %s\n", nt_errstr(status));
|
||||
@ -537,7 +537,7 @@ bool run_smb2_session_reconnect(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli2->conn, cli2->timeout, cli2->smb2.session,
|
||||
cli2->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli2->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) &&
|
||||
!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED))
|
||||
@ -599,7 +599,7 @@ bool run_smb2_session_reconnect(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli2->conn, cli2->timeout, cli2->smb2.session,
|
||||
cli2->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli2->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) &&
|
||||
!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED))
|
||||
@ -664,7 +664,7 @@ bool run_smb2_session_reconnect(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli2->conn, cli2->timeout, cli2->smb2.session,
|
||||
cli2->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli2->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("smb2cli_write returned %s\n", nt_errstr(status));
|
||||
@ -760,7 +760,7 @@ bool run_smb2_tcon_dependence(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli->conn, cli->timeout, cli->smb2.session,
|
||||
cli->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("smb2cli_write returned %s\n", nt_errstr(status));
|
||||
@ -1173,7 +1173,7 @@ bool run_smb2_multi_channel(int dummy)
|
||||
}
|
||||
|
||||
status = smb2cli_write(cli1->conn, cli1->timeout, cli1->smb2.session,
|
||||
cli1->smb2.tid, strlen(hello), 0, fid_persistent,
|
||||
cli1->smb2.tcon, strlen(hello), 0, fid_persistent,
|
||||
fid_volatile, 0, 0, (const uint8_t *)hello);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("smb2cli_write returned %s\n", nt_errstr(status));
|
||||
|
Loading…
x
Reference in New Issue
Block a user