summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/client.h1
-rw-r--r--source3/libsmb/cliconnect.c6
-rw-r--r--source3/libsmb/clientgen.c6
-rw-r--r--source3/libsmb/proto.h1
4 files changed, 11 insertions, 3 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 849a7c08b4..3c99716e62 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -134,6 +134,7 @@ struct cli_state {
struct {
uint16_t mid;
+ uint16_t vc_num;
} smb1;
struct {
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 33e4217d6c..03251f965b 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -418,7 +418,7 @@ struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
SSVAL(vwv+1, 0, 0);
SSVAL(vwv+2, 0, CLI_BUFFER_SIZE);
SSVAL(vwv+3, 0, 2);
- SSVAL(vwv+4, 0, cli->pid);
+ SSVAL(vwv+4, 0, cli_state_get_vc_num(cli));
SIVAL(vwv+5, 0, cli->sesskey);
SSVAL(vwv+7, 0, 0);
SSVAL(vwv+8, 0, 0);
@@ -637,7 +637,7 @@ static struct tevent_req *cli_session_setup_plain_send(
SSVAL(vwv+1, 0, 0);
SSVAL(vwv+2, 0, CLI_BUFFER_SIZE);
SSVAL(vwv+3, 0, 2);
- SSVAL(vwv+4, 0, cli->pid);
+ SSVAL(vwv+4, 0, cli_state_get_vc_num(cli));
SIVAL(vwv+5, 0, cli->sesskey);
SSVAL(vwv+7, 0, 0);
SSVAL(vwv+8, 0, 0);
@@ -985,7 +985,7 @@ static struct tevent_req *cli_session_setup_nt1_send(
SSVAL(vwv+1, 0, 0);
SSVAL(vwv+2, 0, CLI_BUFFER_SIZE);
SSVAL(vwv+3, 0, 2);
- SSVAL(vwv+4, 0, cli->pid);
+ SSVAL(vwv+4, 0, cli_state_get_vc_num(cli));
SIVAL(vwv+5, 0, cli->sesskey);
SSVAL(vwv+7, 0, lm_response.length);
SSVAL(vwv+8, 0, nt_response.length);
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index ddad96c826..aac38df360 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -240,6 +240,7 @@ struct cli_state *cli_initialise_ex(int signing_state)
cli->initialised = 1;
cli->smb1.mid = 1;
+ cli->smb1.vc_num = cli->pid;
return cli;
@@ -342,6 +343,11 @@ void cli_sockopt(struct cli_state *cli, const char *options)
set_socket_options(cli->fd, options);
}
+uint16_t cli_state_get_vc_num(struct cli_state *cli)
+{
+ return cli->smb1.vc_num;
+}
+
/****************************************************************************
Set the PID to use for smb messages. Return the old pid.
****************************************************************************/
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 070b4b1af1..7ba2aaccad 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -164,6 +164,7 @@ struct cli_state *cli_initialise_ex(int signing_state);
void cli_nt_pipes_close(struct cli_state *cli);
void cli_shutdown(struct cli_state *cli);
void cli_sockopt(struct cli_state *cli, const char *options);
+uint16_t cli_state_get_vc_num(struct cli_state *cli);
uint16 cli_setpid(struct cli_state *cli, uint16 pid);
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,