s3: Fix ntlm_auth and winbindd to use new common libcli/auth APIs
authorAndrew Bartlett <abartlet@samba.org>
Tue, 14 Apr 2009 09:33:04 +0000 (19:33 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Apr 2009 09:33:04 +0000 (19:33 +1000)
source3/utils/ntlm_auth.c
source3/winbindd/winbindd_cm.c

index 66108bd16795b4a0b3b051989c912cea5f02c9c9..50688bf6986b0a194313fb614e5fe62a98caf6da 100644 (file)
@@ -572,14 +572,14 @@ static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *u
        nt_lm_owf_gen (opt_password, nt_pw.hash, lm_pw.hash);
        
        nt_status = ntlm_password_check(ntlmssp_state,
        nt_lm_owf_gen (opt_password, nt_pw.hash, lm_pw.hash);
        
        nt_status = ntlm_password_check(ntlmssp_state,
-                                       true, true,
+                                       true, true, 0,
                                        &ntlmssp_state->chal,
                                        &ntlmssp_state->lm_resp,
                                        &ntlmssp_state->nt_resp, 
                                        ntlmssp_state->user, 
                                        ntlmssp_state->user, 
                                        ntlmssp_state->domain,
                                        &ntlmssp_state->chal,
                                        &ntlmssp_state->lm_resp,
                                        &ntlmssp_state->nt_resp, 
                                        ntlmssp_state->user, 
                                        ntlmssp_state->user, 
                                        ntlmssp_state->domain,
-                                       lm_pw, nt_pw, user_session_key, lm_session_key);
+                                       &lm_pw, &nt_pw, user_session_key, lm_session_key);
        
        if (NT_STATUS_IS_OK(nt_status)) {
                ntlmssp_state->auth_context = talloc_asprintf(ntlmssp_state,
        
        if (NT_STATUS_IS_OK(nt_status)) {
                ntlmssp_state->auth_context = talloc_asprintf(ntlmssp_state,
index bcb3a8dfadbb454826695fb7de89ad552f49e55e..f22f213eec6a927c41f6084a99c1eb73199e98a8 100644 (file)
@@ -1964,8 +1964,8 @@ static void set_dc_type_and_flags( struct winbindd_domain *domain )
 /**********************************************************************
 ***********************************************************************/
 
 /**********************************************************************
 ***********************************************************************/
 
-static bool cm_get_schannel_dcinfo(struct winbindd_domain *domain,
-                                  struct dcinfo **ppdc)
+static bool cm_get_schannel_creds(struct winbindd_domain *domain,
+                                  struct netlogon_creds_CredentialState **ppdc)
 {
        NTSTATUS result;
        struct rpc_pipe_client *netlogon_pipe;
 {
        NTSTATUS result;
        struct rpc_pipe_client *netlogon_pipe;
@@ -1979,7 +1979,7 @@ static bool cm_get_schannel_dcinfo(struct winbindd_domain *domain,
                return False;
        }
 
                return False;
        }
 
-       /* Return a pointer to the struct dcinfo from the
+       /* Return a pointer to the struct netlogon_creds_CredentialState from the
           netlogon pipe. */
 
        if (!domain->conn.netlogon_pipe->dc) {
           netlogon pipe. */
 
        if (!domain->conn.netlogon_pipe->dc) {
@@ -1995,7 +1995,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 {
        struct winbindd_cm_conn *conn;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
 {
        struct winbindd_cm_conn *conn;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-       struct dcinfo *p_dcinfo;
+       struct netlogon_creds_CredentialState *p_creds;
        char *machine_password = NULL;
        char *machine_account = NULL;
        char *domain_name = NULL;
        char *machine_password = NULL;
        char *machine_account = NULL;
        char *domain_name = NULL;
@@ -2082,7 +2082,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 
        /* Fall back to schannel if it's a W2K pre-SP1 box. */
 
 
        /* Fall back to schannel if it's a W2K pre-SP1 box. */
 
-       if (!cm_get_schannel_dcinfo(domain, &p_dcinfo)) {
+       if (!cm_get_schannel_creds(domain, &p_creds)) {
                /* If this call fails - conn->cli can now be NULL ! */
                DEBUG(10, ("cm_connect_sam: Could not get schannel auth info "
                           "for domain %s, trying anon\n", domain->name));
                /* If this call fails - conn->cli can now be NULL ! */
                DEBUG(10, ("cm_connect_sam: Could not get schannel auth info "
                           "for domain %s, trying anon\n", domain->name));
@@ -2090,7 +2090,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
        }
        result = cli_rpc_pipe_open_schannel_with_key
                (conn->cli, &ndr_table_samr.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
        }
        result = cli_rpc_pipe_open_schannel_with_key
                (conn->cli, &ndr_table_samr.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
-                domain->name, p_dcinfo, &conn->samr_pipe);
+                domain->name, p_creds, &conn->samr_pipe);
 
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(10,("cm_connect_sam: failed to connect to SAMR pipe for "
 
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(10,("cm_connect_sam: failed to connect to SAMR pipe for "
@@ -2161,7 +2161,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 {
        struct winbindd_cm_conn *conn;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
 {
        struct winbindd_cm_conn *conn;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-       struct dcinfo *p_dcinfo;
+       struct netlogon_creds_CredentialState *p_creds;
 
        result = init_dc_connection(domain);
        if (!NT_STATUS_IS_OK(result))
 
        result = init_dc_connection(domain);
        if (!NT_STATUS_IS_OK(result))
@@ -2218,7 +2218,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 
        /* Fall back to schannel if it's a W2K pre-SP1 box. */
 
 
        /* Fall back to schannel if it's a W2K pre-SP1 box. */
 
-       if (!cm_get_schannel_dcinfo(domain, &p_dcinfo)) {
+       if (!cm_get_schannel_creds(domain, &p_creds)) {
                /* If this call fails - conn->cli can now be NULL ! */
                DEBUG(10, ("cm_connect_lsa: Could not get schannel auth info "
                           "for domain %s, trying anon\n", domain->name));
                /* If this call fails - conn->cli can now be NULL ! */
                DEBUG(10, ("cm_connect_lsa: Could not get schannel auth info "
                           "for domain %s, trying anon\n", domain->name));
@@ -2227,7 +2227,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
        result = cli_rpc_pipe_open_schannel_with_key
                (conn->cli, &ndr_table_lsarpc.syntax_id,
                 PIPE_AUTH_LEVEL_PRIVACY,
        result = cli_rpc_pipe_open_schannel_with_key
                (conn->cli, &ndr_table_lsarpc.syntax_id,
                 PIPE_AUTH_LEVEL_PRIVACY,
-                domain->name, p_dcinfo, &conn->lsa_pipe);
+                domain->name, p_creds, &conn->lsa_pipe);
 
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(10,("cm_connect_lsa: failed to connect to LSA pipe for "
 
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(10,("cm_connect_lsa: failed to connect to LSA pipe for "