r26676: libcli: Fill in lp_workgroup() again, should fix my breakage of cifsdd tests...
[ira/wip.git] / source / libcli / smb_composite / sesssetup.c
index 579706261ab933c99eb0b4a6fd616da81a799626..ce7bcc143ed44d745d96a18c4955757405e3b88c 100644 (file)
@@ -29,6 +29,7 @@
 #include "auth/gensec/gensec.h"
 #include "auth/credentials/credentials.h"
 #include "version.h"
+#include "param/param.h"
 
 struct sesssetup_state {
        union smb_sesssetup setup;
@@ -128,7 +129,7 @@ static void request_handler(struct smbcli_request *req)
        case RAW_SESSSETUP_SPNEGO:
                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 */
+                       /* we need 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, 
@@ -222,14 +223,14 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
        NTSTATUS nt_status;
        struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
        const char *password = cli_credentials_get_password(io->in.credentials);
-       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup());
+       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup(global_loadparm));
        DATA_BLOB session_key;
        int flags = CLI_CRED_NTLM_AUTH;
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                flags |= CLI_CRED_NTLMv2_AUTH;
        }
 
@@ -262,7 +263,7 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
                set_user_session_key(session, &session_key);
                
                data_blob_free(&session_key);
-       } else if (lp_client_plaintext_auth()) {
+       } else if (lp_client_plaintext_auth(global_loadparm)) {
                state->setup.nt1.in.password1 = data_blob_talloc(state, password, strlen(password));
                state->setup.nt1.in.password2 = data_blob(NULL, 0);
        } else {
@@ -289,14 +290,14 @@ static NTSTATUS session_setup_old(struct composite_context *c,
        NTSTATUS nt_status;
        struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
        const char *password = cli_credentials_get_password(io->in.credentials);
-       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup());
+       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup(global_loadparm));
        DATA_BLOB session_key;
        int flags = 0;
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                flags |= CLI_CRED_NTLMv2_AUTH;
        }
 
@@ -323,7 +324,7 @@ static NTSTATUS session_setup_old(struct composite_context *c,
                set_user_session_key(session, &session_key);
                
                data_blob_free(&session_key);
-       } else if (lp_client_plaintext_auth()) {
+       } else if (lp_client_plaintext_auth(global_loadparm)) {
                state->setup.old.in.password = data_blob_talloc(state, password, strlen(password));
        } else {
                /* could match windows client and return 'cannot logon from this workstation', but it just confuses everybody */
@@ -364,7 +365,8 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
 
        smbcli_temp_set_signing(session->transport);
 
-       status = gensec_client_start(session, &session->gensec, c->event_ctx);
+       status = gensec_client_start(session, &session->gensec, c->event_ctx,
+                                    global_loadparm);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, ("Failed to start GENSEC client mode: %s\n", nt_errstr(status)));
                return status;
@@ -374,7 +376,7 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
 
        status = gensec_set_credentials(session->gensec, io->in.credentials);
        if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(1, ("Failed to start set GENSEC client credentails: %s\n", 
+               DEBUG(1, ("Failed to start set GENSEC client credentials: %s\n", 
                          nt_errstr(status)));
                return status;
        }
@@ -417,7 +419,7 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
                }
        }
 
-       if (chosen_oid == GENSEC_OID_SPNEGO) {
+       if ((const void *)chosen_oid == (const void *)GENSEC_OID_SPNEGO) {
                status = gensec_update(session->gensec, state,
                                       session->transport->negotiate.secblob,
                                       &state->setup.spnego.in.secblob);