summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-13 14:33:31 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-15 10:25:17 +0200
commit3f00cce9b3502c8ec9b3f7fcf5b2024c10550f82 (patch)
treea0ea277fecceb874d1a77b459ccb0a833945b8d9 /source3/libsmb
parent4f7be46d99b68040c3b42f3a4662fccd777012a3 (diff)
downloadsamba-3f00cce9b3502c8ec9b3f7fcf5b2024c10550f82.tar.gz
samba-3f00cce9b3502c8ec9b3f7fcf5b2024c10550f82.tar.bz2
samba-3f00cce9b3502c8ec9b3f7fcf5b2024c10550f82.zip
s3:libsmb: pass max_protocol to cli_negprot()
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c11
-rw-r--r--source3/libsmb/clidfs.c4
-rw-r--r--source3/libsmb/libsmb_server.c2
-rw-r--r--source3/libsmb/passchange.c4
-rw-r--r--source3/libsmb/proto.h5
5 files changed, 12 insertions, 14 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 6fa724f7b7..23518ea1b8 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2545,7 +2545,8 @@ static void cli_negprot_done(struct tevent_req *subreq);
struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct cli_state *cli)
+ struct cli_state *cli,
+ enum protocol_types max_protocol)
{
struct tevent_req *req, *subreq;
struct cli_negprot_state *state;
@@ -2558,7 +2559,7 @@ struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
return NULL;
}
state->cli = cli;
- state->max_protocol = cli->protocol;
+ state->max_protocol = max_protocol;
/* setup the protocol strings */
for (numprots=0; numprots < ARRAY_SIZE(prots); numprots++) {
@@ -2765,7 +2766,7 @@ NTSTATUS cli_negprot_recv(struct tevent_req *req)
return tevent_req_simple_recv_ntstatus(req);
}
-NTSTATUS cli_negprot(struct cli_state *cli)
+NTSTATUS cli_negprot(struct cli_state *cli, enum protocol_types max_protocol)
{
TALLOC_CTX *frame = talloc_stackframe();
struct event_context *ev;
@@ -2786,7 +2787,7 @@ NTSTATUS cli_negprot(struct cli_state *cli)
goto fail;
}
- req = cli_negprot_send(frame, ev, cli);
+ req = cli_negprot_send(frame, ev, cli, max_protocol);
if (req == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
@@ -2942,7 +2943,7 @@ NTSTATUS cli_start_connection(struct cli_state **output_cli,
return nt_status;
}
- nt_status = cli_negprot(cli);
+ nt_status = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1, ("failed negprot: %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 68a6724d24..b066b8bd12 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -144,11 +144,9 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
if (max_protocol == 0) {
max_protocol = PROTOCOL_NT1;
}
- c->protocol = max_protocol;
-
DEBUG(4,(" session request ok\n"));
- status = cli_negprot(c);
+ status = cli_negprot(c, max_protocol);
if (!NT_STATUS_IS_OK(status)) {
d_printf("protocol negotiation failed: %s\n",
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 005f2cdf8e..0af9798d2b 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -439,7 +439,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
cli_set_timeout(c, smbc_getTimeout(context));
- status = cli_negprot(c);
+ status = cli_negprot(c, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
cli_shutdown(c);
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index e5c336f882..58997e4c82 100644
--- a/source3/libsmb/passchange.c
+++ b/source3/libsmb/passchange.c
@@ -66,9 +66,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
return result;
}
- cli->protocol = PROTOCOL_NT1;
-
- result = cli_negprot(cli);
+ result = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(result)) {
if (asprintf(err_str, "machine %s rejected the negotiate "
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 4992d95c96..88035ffa6b 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -67,10 +67,11 @@ struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
struct cli_state *cli);
NTSTATUS cli_tdis_recv(struct tevent_req *req);
NTSTATUS cli_tdis(struct cli_state *cli);
-NTSTATUS cli_negprot(struct cli_state *cli);
+NTSTATUS cli_negprot(struct cli_state *cli, enum protocol_types max_protocol);
struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct cli_state *cli);
+ struct cli_state *cli,
+ enum protocol_types max_protocol);
NTSTATUS cli_negprot_recv(struct tevent_req *req);
NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
uint16_t port, int name_type, const char *myname,