summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/smb2cli_base.c20
-rw-r--r--source3/libsmb/smb2cli_base.h12
-rw-r--r--source3/libsmb/smb2cli_close.c6
-rw-r--r--source3/libsmb/smb2cli_create.c6
-rw-r--r--source3/libsmb/smb2cli_flush.c6
-rw-r--r--source3/libsmb/smb2cli_negprot.c5
-rw-r--r--source3/libsmb/smb2cli_query_directory.c6
-rw-r--r--source3/libsmb/smb2cli_read.c6
-rw-r--r--source3/libsmb/smb2cli_session.c11
-rw-r--r--source3/libsmb/smb2cli_tcon.c12
-rw-r--r--source3/libsmb/smb2cli_write.c6
11 files changed, 80 insertions, 16 deletions
diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c
index dd212730bc..9fc824c6b2 100644
--- a/source3/libsmb/smb2cli_base.c
+++ b/source3/libsmb/smb2cli_base.c
@@ -175,7 +175,11 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
uint16_t cmd,
- uint32_t flags,
+ uint32_t additional_flags,
+ uint32_t clear_flags,
+ uint32_t pid,
+ uint32_t tid,
+ uint64_t uid,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
@@ -183,6 +187,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req;
struct smb2cli_req_state *state;
+ uint32_t flags = 0;
req = tevent_req_create(mem_ctx, &state,
struct smb2cli_req_state);
@@ -198,6 +203,9 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
return NULL;
}
+ flags |= additional_flags;
+ flags &= ~clear_flags;
+
state->fixed = fixed;
state->fixed_len = fixed_len;
state->dyn = dyn;
@@ -306,7 +314,11 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
uint16_t cmd,
- uint32_t flags,
+ uint32_t additional_flags,
+ uint32_t clear_flags,
+ uint32_t pid,
+ uint32_t tid,
+ uint64_t uid,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
@@ -315,7 +327,9 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req;
NTSTATUS status;
- req = smb2cli_req_create(mem_ctx, ev, cli, cmd, flags,
+ req = smb2cli_req_create(mem_ctx, ev, cli, cmd,
+ additional_flags, clear_flags,
+ pid, tid, uid,
fixed, fixed_len, dyn, dyn_len);
if (req == NULL) {
return NULL;
diff --git a/source3/libsmb/smb2cli_base.h b/source3/libsmb/smb2cli_base.h
index 85cf347156..348f842d40 100644
--- a/source3/libsmb/smb2cli_base.h
+++ b/source3/libsmb/smb2cli_base.h
@@ -24,7 +24,11 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
uint16_t cmd,
- uint32_t flags,
+ uint32_t additional_flags,
+ uint32_t clear_flags,
+ uint32_t pid,
+ uint32_t tid,
+ uint64_t uid,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
@@ -35,7 +39,11 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
uint16_t cmd,
- uint32_t flags,
+ uint32_t additional_flags,
+ uint32_t clear_flags,
+ uint32_t pid,
+ uint32_t tid,
+ uint64_t uid,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
diff --git a/source3/libsmb/smb2cli_close.c b/source3/libsmb/smb2cli_close.c
index fcbf298596..3c6ad9fb3a 100644
--- a/source3/libsmb/smb2cli_close.c
+++ b/source3/libsmb/smb2cli_close.c
@@ -53,7 +53,11 @@ struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
SBVAL(fixed, 8, fid_persistent);
SBVAL(fixed, 16, fid_volatile);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_CLOSE, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_CLOSE,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
NULL, 0);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_create.c b/source3/libsmb/smb2cli_create.c
index 794b1f1bff..ecb220d4ac 100644
--- a/source3/libsmb/smb2cli_create.c
+++ b/source3/libsmb/smb2cli_create.c
@@ -127,7 +127,11 @@ struct tevent_req *smb2cli_create_send(
data_blob_free(&blob);
}
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_CREATE, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_CREATE,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
dyn, dyn_len);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_flush.c b/source3/libsmb/smb2cli_flush.c
index b93c7851f1..6fe7178d86 100644
--- a/source3/libsmb/smb2cli_flush.c
+++ b/source3/libsmb/smb2cli_flush.c
@@ -51,7 +51,11 @@ struct tevent_req *smb2cli_flush_send(TALLOC_CTX *mem_ctx,
SBVAL(fixed, 8, fid_persistent);
SBVAL(fixed, 16, fid_volatile);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_FLUSH, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_FLUSH,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
NULL, 0);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_negprot.c b/source3/libsmb/smb2cli_negprot.c
index 305632283f..75532cd477 100644
--- a/source3/libsmb/smb2cli_negprot.c
+++ b/source3/libsmb/smb2cli_negprot.c
@@ -66,7 +66,10 @@ struct tevent_req *smb2cli_negprot_send(TALLOC_CTX *mem_ctx,
SSVAL(buf, 0, 0x202); /* SMB2.002 */
SSVAL(buf, 2, 0x210); /* SMB2.1 */
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_NEGPROT, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_NEGPROT,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ 0, 0, /* tid, uid */
state->fixed, sizeof(state->fixed),
state->dyn, sizeof(state->dyn));
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_query_directory.c b/source3/libsmb/smb2cli_query_directory.c
index f9a1bfe4ee..3feaa07abb 100644
--- a/source3/libsmb/smb2cli_query_directory.c
+++ b/source3/libsmb/smb2cli_query_directory.c
@@ -75,7 +75,11 @@ struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
SSVAL(fixed, 26, dyn_len);
SSVAL(fixed, 28, outbuf_len);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_FIND, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_FIND,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
dyn, dyn_len);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_read.c b/source3/libsmb/smb2cli_read.c
index c348c9937c..bcdbd87e6a 100644
--- a/source3/libsmb/smb2cli_read.c
+++ b/source3/libsmb/smb2cli_read.c
@@ -64,7 +64,11 @@ struct tevent_req *smb2cli_read_send(TALLOC_CTX *mem_ctx,
SBVAL(fixed, 32, minimum_count);
SBVAL(fixed, 40, remaining_bytes);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_READ, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_READ,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
NULL, 0);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_session.c b/source3/libsmb/smb2cli_session.c
index c7d880e7aa..7cc184236b 100644
--- a/source3/libsmb/smb2cli_session.c
+++ b/source3/libsmb/smb2cli_session.c
@@ -61,7 +61,10 @@ static struct tevent_req *smb2cli_sesssetup_blob_send(TALLOC_CTX *mem_ctx,
SSVAL(buf, 14, blob->length);
SBVAL(buf, 16, 0); /* PreviousSessionId */
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_SESSSETUP, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_SESSSETUP,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ 0, 0, /* tid, uid */
state->fixed, sizeof(state->fixed),
blob->data, blob->length);
if (tevent_req_nomem(subreq, req)) {
@@ -324,7 +327,11 @@ struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx,
}
SSVAL(state->fixed, 0, 4);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_LOGOFF, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_LOGOFF,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ 0, /* tid */
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
NULL, 0);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_tcon.c b/source3/libsmb/smb2cli_tcon.c
index 705f8fc99c..2872c371c0 100644
--- a/source3/libsmb/smb2cli_tcon.c
+++ b/source3/libsmb/smb2cli_tcon.c
@@ -70,7 +70,11 @@ struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx,
SSVAL(fixed, 4, SMB2_HDR_BODY + 8);
SSVAL(fixed, 6, dyn_len);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_TCON, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_TCON,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ 0, /* tid */
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
dyn, dyn_len);
if (tevent_req_nomem(subreq, req)) {
@@ -166,7 +170,11 @@ struct tevent_req *smb2cli_tdis_send(TALLOC_CTX *mem_ctx,
}
SSVAL(state->fixed, 0, 4);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_TDIS, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_TDIS,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
NULL, 0);
if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/libsmb/smb2cli_write.c b/source3/libsmb/smb2cli_write.c
index ce672e44e9..98d754a9b0 100644
--- a/source3/libsmb/smb2cli_write.c
+++ b/source3/libsmb/smb2cli_write.c
@@ -63,7 +63,11 @@ struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx,
SIVAL(fixed, 36, remaining_bytes);
SIVAL(fixed, 44, flags);
- subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_WRITE, 0,
+ subreq = smb2cli_req_send(state, ev, cli, SMB2_OP_WRITE,
+ 0, 0, /* flags */
+ cli->smb2.pid,
+ cli->smb2.tid,
+ cli->smb2.uid,
state->fixed, sizeof(state->fixed),
data, length);
if (tevent_req_nomem(subreq, req)) {