DEBUG(3,("got session\n"));
- status = cli_negprot(cli);
+ status = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(mutex);
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;
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++) {
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;
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;
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);
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",
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);
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 "
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,
return;
}
- status = cli_negprot(cli);
+ status = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
cli_shutdown(cli);
return;
return NULL;
}
- status = cli_negprot(c);
+ status = cli_negprot(c, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("protocol negotiation failed: %s\n",
nt_errstr(status)));
return NULL;
}
- c->protocol = max_protocol;
-
- status = cli_negprot(c);
+ status = cli_negprot(c, max_protocol);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("protocol negotiation failed: %s\n",
nt_errstr(status)));
for (i=0;i<50000;i++) {
struct tevent_req *req;
- req = cli_negprot_send(ev, ev, cli);
+ req = cli_negprot_send(ev, ev, cli, PROTOCOL_NT1);
if (req == NULL) {
TALLOC_FREE(ev);
return false;
}
disable_spnego = false;
- status = cli_negprot(c_nt);
+ status = cli_negprot(c_nt, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
printf("%s rejected the NT-error negprot (%s)\n", host,
disable_spnego = false;
force_dos_errors = false;
- status = cli_negprot(c_dos);
+ status = cli_negprot(c_dos, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
printf("%s rejected the DOS-error negprot (%s)\n", host,
nt_errstr(status));
if (!NT_STATUS_IS_OK(status)) {
return false;
}
- status = cli_negprot(cli);
+ status = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status))
goto done;
if (cli_state_protocol(cli) < PROTOCOL_NT1)
goto done;
}
- status = cli_negprot(cli);
+ status = cli_negprot(cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
fprintf(stderr, _("Protocol negotiation failed: %s\n"),
nt_errstr(status));
cli_set_timeout(*cli, 10000); /* 10 seconds */
- result = cli_negprot(*cli);
+ result = cli_negprot(*cli, PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(1, ("cli_negprot failed: %s\n", nt_errstr(result)));