Ignore:
Timestamp:
Oct 30, 2009, 9:39:05 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 to 3.3.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/winbindd/winbindd_cm.c

    r223 r342  
    858858                                                              machine_password,
    859859                                                              lp_workgroup(),
    860                                                               domain->name);
     860                                                              domain->alt_name);
    861861
    862862                        if (!ADS_ERR_OK(ads_status)) {
     
    15431543        }
    15441544
     1545        if (conn->lsa_pipe_tcp != NULL) {
     1546                TALLOC_FREE(conn->lsa_pipe_tcp);
     1547                /* Ok, it must be dead. Drop timeout to 0.5 sec. */
     1548                if (conn->cli) {
     1549                        cli_set_timeout(conn->cli, 500);
     1550                }
     1551        }
     1552
    15451553        if (conn->netlogon_pipe != NULL) {
    15461554                TALLOC_FREE(conn->netlogon_pipe);
     
    19171925                  domain->name, domain->active_directory ? "" : "NOT "));
    19181926
     1927        domain->can_do_ncacn_ip_tcp = domain->active_directory;
     1928
    19191929        TALLOC_FREE(cli);
    19201930
     
    20392049        result = cli_rpc_pipe_open_spnego_ntlmssp(conn->cli,
    20402050                                                  &ndr_table_samr.syntax_id,
     2051                                                  NCACN_NP,
    20412052                                                  PIPE_AUTH_LEVEL_PRIVACY,
    20422053                                                  domain_name,
     
    20822093        }
    20832094        result = cli_rpc_pipe_open_schannel_with_key
    2084                 (conn->cli, &ndr_table_samr.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
     2095                (conn->cli, &ndr_table_samr.syntax_id, NCACN_NP,
     2096                PIPE_AUTH_LEVEL_PRIVACY,
    20852097                 domain->name, p_dcinfo, &conn->samr_pipe);
    20862098
     
    21372149 done:
    21382150
    2139         if (!NT_STATUS_IS_OK(result)) {
     2151        if (NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED)) {
     2152                /*
     2153                 * if we got access denied, we might just have no access rights
     2154                 * to talk to the remote samr server server (e.g. when we are a
     2155                 * PDC and we are connecting a w2k8 pdc via an interdomain
     2156                 * trust). In that case do not invalidate the whole connection
     2157                 * stack
     2158                 */
     2159                TALLOC_FREE(conn->samr_pipe);
     2160                ZERO_STRUCT(conn->sam_domain_handle);
     2161                return result;
     2162        } else if (!NT_STATUS_IS_OK(result)) {
    21402163                invalidate_cm_connection(conn);
    21412164                return result;
     
    21472170        SAFE_FREE(machine_account);
    21482171        return result;
     2172}
     2173
     2174/**********************************************************************
     2175 open an schanneld ncacn_ip_tcp connection to LSA
     2176***********************************************************************/
     2177
     2178NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
     2179                            TALLOC_CTX *mem_ctx,
     2180                            struct rpc_pipe_client **cli)
     2181{
     2182        struct winbindd_cm_conn *conn;
     2183        NTSTATUS status;
     2184
     2185        DEBUG(10,("cm_connect_lsa_tcp\n"));
     2186
     2187        status = init_dc_connection(domain);
     2188        if (!NT_STATUS_IS_OK(status)) {
     2189                return status;
     2190        }
     2191
     2192        conn = &domain->conn;
     2193
     2194        if (conn->lsa_pipe_tcp &&
     2195            conn->lsa_pipe_tcp->transport_type == NCACN_IP_TCP &&
     2196            conn->lsa_pipe_tcp->auth->auth_level == PIPE_AUTH_LEVEL_PRIVACY) {
     2197                goto done;
     2198        }
     2199
     2200        TALLOC_FREE(conn->lsa_pipe_tcp);
     2201
     2202        status = cli_rpc_pipe_open_schannel(conn->cli,
     2203                                            &ndr_table_lsarpc.syntax_id,
     2204                                            NCACN_IP_TCP,
     2205                                            PIPE_AUTH_LEVEL_PRIVACY,
     2206                                            domain->name,
     2207                                            &conn->lsa_pipe_tcp);
     2208        if (!NT_STATUS_IS_OK(status)) {
     2209                DEBUG(10,("cli_rpc_pipe_open_schannel failed: %s\n",
     2210                        nt_errstr(status)));
     2211                goto done;
     2212        }
     2213
     2214 done:
     2215        if (!NT_STATUS_IS_OK(status)) {
     2216                TALLOC_FREE(conn->lsa_pipe_tcp);
     2217                return status;
     2218        }
     2219
     2220        *cli = conn->lsa_pipe_tcp;
     2221
     2222        return status;
    21492223}
    21502224
     
    21792253         * authenticated LSA pipe with sign & seal. */
    21802254        result = cli_rpc_pipe_open_spnego_ntlmssp
    2181                 (conn->cli, &ndr_table_lsarpc.syntax_id,
     2255                (conn->cli, &ndr_table_lsarpc.syntax_id, NCACN_NP,
    21822256                 PIPE_AUTH_LEVEL_PRIVACY,
    21832257                 conn->cli->domain, conn->cli->user_name, conn_pwd,
     
    22202294        }
    22212295        result = cli_rpc_pipe_open_schannel_with_key
    2222                 (conn->cli, &ndr_table_lsarpc.syntax_id,
     2296                (conn->cli, &ndr_table_lsarpc.syntax_id, NCACN_NP,
    22232297                 PIPE_AUTH_LEVEL_PRIVACY,
    22242298                 domain->name, p_dcinfo, &conn->lsa_pipe);
     
    23672441
    23682442        result = cli_rpc_pipe_open_schannel_with_key(
    2369                 conn->cli, &ndr_table_netlogon.syntax_id,
     2443                conn->cli, &ndr_table_netlogon.syntax_id, NCACN_NP,
    23702444                PIPE_AUTH_LEVEL_PRIVACY, domain->name, netlogon_pipe->dc,
    23712445                &conn->netlogon_pipe);
Note: See TracChangeset for help on using the changeset viewer.