summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-19 12:52:10 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-20 15:54:31 +0200
commit9fb7e228f5a6e39dd22e1c56733c61178ee0be49 (patch)
tree1e6739858d72ea9411de477a217f4ba4327212d9 /source3
parent6c31b610e4c44105ddeb9a5ffd8e64ef3954e79e (diff)
downloadsamba-9fb7e228f5a6e39dd22e1c56733c61178ee0be49.tar.gz
samba-9fb7e228f5a6e39dd22e1c56733c61178ee0be49.tar.bz2
samba-9fb7e228f5a6e39dd22e1c56733c61178ee0be49.zip
s3:libsmb: add cli->smb1.vc_num and hide it behind cli_state_get_vc_num()
This makes it clearer, why we send the pid value in the session setup. metze
Diffstat (limited to 'source3')
-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,