From 35e45534c64930a0f22c5975c64be41d96265a00 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 25 Apr 2008 15:59:22 +0100 Subject: Revert to using the old CIFS connection API. Rather than add a new 'out' member to the API, simply fill in the 'tree' early enough that we can access the server challenge there. Andrew Bartlett (This used to be commit 6dbbcf8aaf9b93af970d1701dfb185460d4dc788) --- source4/libcli/smb_composite/connect.c | 24 ++++++++---------------- source4/libcli/smb_composite/smb_composite.h | 1 - 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c index 4400c61a81..39c614f042 100644 --- a/source4/libcli/smb_composite/connect.c +++ b/source4/libcli/smb_composite/connect.c @@ -122,9 +122,6 @@ static NTSTATUS connect_session_setup_anon(struct composite_context *c, state->session->vuid = state->io_setup->out.vuid; /* setup for a tconx */ - io->out.tree = smbcli_tree_init(state->session, state, true); - NT_STATUS_HAVE_NO_MEMORY(io->out.tree); - state->io_tcon = talloc(c, union smb_tcon); NT_STATUS_HAVE_NO_MEMORY(state->io_tcon); @@ -211,10 +208,6 @@ static NTSTATUS connect_session_setup(struct composite_context *c, return NT_STATUS_OK; } - /* setup for a tconx */ - io->out.tree = smbcli_tree_init(state->session, state, true); - NT_STATUS_HAVE_NO_MEMORY(io->out.tree); - state->io_tcon = talloc(c, union smb_tcon); NT_STATUS_HAVE_NO_MEMORY(state->io_tcon); @@ -259,11 +252,14 @@ static NTSTATUS connect_negprot(struct composite_context *c, status = smb_raw_negotiate_recv(state->req); NT_STATUS_NOT_OK_RETURN(status); - if (!(state->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY)) { - io->out.negprot_challenge = state->transport->negotiate.secblob; - } else { - io->out.negprot_challenge = data_blob(NULL, 0); - } + /* next step is a session setup */ + state->session = smbcli_session_init(state->transport, state, true); + NT_STATUS_HAVE_NO_MEMORY(state->session); + + /* setup for a tconx (or at least have the structure ready to + * return, if we won't go that far) */ + io->out.tree = smbcli_tree_init(state->session, state, true); + NT_STATUS_HAVE_NO_MEMORY(io->out.tree); /* If we don't have any credentials then this indicates that * we don't want to do a session setup */ @@ -272,10 +268,6 @@ static NTSTATUS connect_negprot(struct composite_context *c, return NT_STATUS_OK; } - /* next step is a session setup */ - state->session = smbcli_session_init(state->transport, state, true); - NT_STATUS_HAVE_NO_MEMORY(state->session); - state->io_setup = talloc(c, struct smb_composite_sesssetup); NT_STATUS_HAVE_NO_MEMORY(state->io_setup); diff --git a/source4/libcli/smb_composite/smb_composite.h b/source4/libcli/smb_composite/smb_composite.h index 80746f2732..afee11ce3b 100644 --- a/source4/libcli/smb_composite/smb_composite.h +++ b/source4/libcli/smb_composite/smb_composite.h @@ -101,7 +101,6 @@ struct smb_composite_connect { struct { struct smbcli_tree *tree; bool anonymous_fallback_done; - DATA_BLOB negprot_challenge; } out; }; -- cgit