summaryrefslogtreecommitdiff
path: root/libcli/smb/smbXcli_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcli/smb/smbXcli_base.c')
-rw-r--r--libcli/smb/smbXcli_base.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 1d473690c3..c41890d6df 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -1095,7 +1095,6 @@ static bool smb1cli_req_cancel(struct tevent_req *req)
uint16_t flags2;
uint32_t pid;
uint16_t tid;
- uint16_t uid;
uint16_t mid;
struct tevent_req *subreq;
NTSTATUS status;
@@ -1105,7 +1104,6 @@ static bool smb1cli_req_cancel(struct tevent_req *req)
pid = SVAL(state->smb1.hdr, HDR_PID);
pid |= SVAL(state->smb1.hdr, HDR_PIDHIGH)<<16;
tid = SVAL(state->smb1.hdr, HDR_TID);
- uid = SVAL(state->smb1.hdr, HDR_UID);
mid = SVAL(state->smb1.hdr, HDR_MID);
subreq = smb1cli_req_create(state, state->ev,
@@ -1114,7 +1112,8 @@ static bool smb1cli_req_cancel(struct tevent_req *req)
flags, 0,
flags2, 0,
0, /* timeout */
- pid, tid, uid,
+ pid, tid,
+ state->session,
0, NULL, /* vwv */
0, NULL); /* bytes */
if (subreq == NULL) {
@@ -1151,7 +1150,7 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx,
uint32_t timeout_msec,
uint32_t pid,
uint16_t tid,
- uint16_t uid,
+ struct smbXcli_session *session,
uint8_t wct, uint16_t *vwv,
int iov_count,
struct iovec *bytes_iov)
@@ -1160,6 +1159,7 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx,
struct smbXcli_req_state *state;
uint8_t flags = 0;
uint16_t flags2 = 0;
+ uint16_t uid = 0;
if (iov_count > MAX_SMB_IOV) {
/*
@@ -1175,6 +1175,11 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx,
}
state->ev = ev;
state->conn = conn;
+ state->session = session;
+
+ if (session) {
+ uid = session->smb1.session_id;
+ }
state->smb1.recv_cmd = 0xFF;
state->smb1.recv_status = NT_STATUS_INTERNAL_ERROR;
@@ -1419,7 +1424,7 @@ struct tevent_req *smb1cli_req_send(TALLOC_CTX *mem_ctx,
uint32_t timeout_msec,
uint32_t pid,
uint16_t tid,
- uint16_t uid,
+ struct smbXcli_session *session,
uint8_t wct, uint16_t *vwv,
uint32_t num_bytes,
const uint8_t *bytes)
@@ -1435,7 +1440,7 @@ struct tevent_req *smb1cli_req_send(TALLOC_CTX *mem_ctx,
additional_flags, clear_flags,
additional_flags2, clear_flags2,
timeout_msec,
- pid, tid, uid,
+ pid, tid, session,
wct, vwv, 1, &iov);
if (req == NULL) {
return NULL;
@@ -3532,7 +3537,7 @@ static struct tevent_req *smbXcli_negprot_smb1_subreq(struct smbXcli_negprot_sta
flags, ~flags,
flags2, ~flags2,
state->timeout_msec,
- 0xFFFE, 0, 0, /* pid, tid, uid */
+ 0xFFFE, 0, NULL, /* pid, tid, session */
0, NULL, /* wct, vwv */
bytes.length, bytes.data);
}