summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-24 16:16:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:41 -0500
commit827d142e9df24f135d36d3981a1a9eaf679ecc8c (patch)
tree9b617581f35565a7ace1f575283a6d44a2a601b6
parent9b97c4d02e5391f5e5df10468c3a5f428e49d955 (diff)
downloadsamba-827d142e9df24f135d36d3981a1a9eaf679ecc8c.tar.gz
samba-827d142e9df24f135d36d3981a1a9eaf679ecc8c.tar.bz2
samba-827d142e9df24f135d36d3981a1a9eaf679ecc8c.zip
r19481: - reset the vuid before trying a new session setup
- only touch session->vuid when needed - it make no sense to set an .spnego.out.vuid metze (This used to be commit 1940fbed154c89d29214ddf293128a70a97bf923)
-rw-r--r--source4/libcli/smb_composite/sesssetup.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index 022faea1d7..d264f588da 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -80,6 +80,8 @@ static void request_handler(struct smbcli_request *req)
/* This doesn't work, as this only happens on old
* protocols, where this comparison won't match. */
if (NT_STATUS_EQUAL(c->status, NT_STATUS_LOGON_FAILURE)) {
+ /* we neet to reset the vuid for a new try */
+ session->vuid = 0;
if (cli_credentials_wrong_password(state->io->in.credentials)) {
nt_status = session_setup_old(c, session,
state->io,
@@ -97,6 +99,8 @@ static void request_handler(struct smbcli_request *req)
case RAW_SESSSETUP_NT1:
state->io->out.vuid = state->setup.nt1.out.vuid;
if (NT_STATUS_EQUAL(c->status, NT_STATUS_LOGON_FAILURE)) {
+ /* we neet to reset the vuid for a new try */
+ session->vuid = 0;
if (cli_credentials_wrong_password(state->io->in.credentials)) {
nt_status = session_setup_nt1(c, session,
state->io,
@@ -112,8 +116,10 @@ static void request_handler(struct smbcli_request *req)
break;
case RAW_SESSSETUP_SPNEGO:
- session->vuid = state->io->out.vuid = state->setup.spnego.out.vuid;
+ state->io->out.vuid = state->setup.spnego.out.vuid;
if (NT_STATUS_EQUAL(c->status, NT_STATUS_LOGON_FAILURE)) {
+ /* we neet to reset the vuid for a new try */
+ session->vuid = 0;
if (cli_credentials_wrong_password(state->io->in.credentials)) {
nt_status = session_setup_spnego(c, session,
state->io,
@@ -160,7 +166,14 @@ static void request_handler(struct smbcli_request *req)
}
if (state->setup.spnego.in.secblob.length) {
+ /*
+ * set the session->vuid value only for calling
+ * smb_raw_sesssetup_send()
+ */
+ uint16_t vuid = session->vuid;
+ session->vuid = state->io->out.vuid;
state->req = smb_raw_sesssetup_send(session, &state->setup);
+ session->vuid = vuid;
state->req->async.fn = request_handler;
state->req->async.private = c;
return;
@@ -343,8 +356,6 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
state->setup.spnego.in.lanman = talloc_asprintf(state, "Samba %s", SAMBA_VERSION_STRING);
state->setup.spnego.in.workgroup = io->in.workgroup;
- state->setup.spnego.out.vuid = session->vuid;
-
smbcli_temp_set_signing(session->transport);
status = gensec_client_start(session, &session->gensec, c->event_ctx);