Ignore:
Timestamp:
Apr 9, 2010, 3:51:41 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5.x: trunk update to 3.5.2

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/winbindd/winbindd_cm.c

    r414 r429  
    16071607static bool connection_ok(struct winbindd_domain *domain)
    16081608{
    1609         if (domain->conn.cli == NULL) {
    1610                 DEBUG(8, ("connection_ok: Connection to %s for domain %s has NULL "
    1611                           "cli!\n", domain->dcname, domain->name));
    1612                 return False;
    1613         }
    1614 
    1615         if (!domain->conn.cli->initialised) {
    1616                 DEBUG(3, ("connection_ok: Connection to %s for domain %s was never "
    1617                           "initialised!\n", domain->dcname, domain->name));
    1618                 return False;
    1619         }
    1620 
    1621         if (domain->conn.cli->fd == -1) {
    1622                 DEBUG(3, ("connection_ok: Connection to %s for domain %s has died or was "
    1623                           "never started (fd == -1)\n",
     1609        bool ok;
     1610
     1611        ok = cli_state_is_connected(domain->conn.cli);
     1612        if (!ok) {
     1613                DEBUG(3, ("connection_ok: Connection to %s for domain %s is not connected\n",
    16241614                          domain->dcname, domain->name));
    16251615                return False;
     
    16471637        }
    16481638
     1639        if (!winbindd_can_contact_domain(domain)) {
     1640                invalidate_cm_connection(&domain->conn);
     1641                domain->initialized = True;
     1642                return NT_STATUS_OK;
     1643        }
     1644
    16491645        if (connection_ok(domain)) {
    16501646                if (!domain->initialized) {
     
    16731669
    16741670        return init_dc_connection_network(domain);
     1671}
     1672
     1673static NTSTATUS init_dc_connection_rpc(struct winbindd_domain *domain)
     1674{
     1675        NTSTATUS status;
     1676
     1677        status = init_dc_connection(domain);
     1678        if (!NT_STATUS_IS_OK(status)) {
     1679                return status;
     1680        }
     1681
     1682        if (!domain->internal && domain->conn.cli == NULL) {
     1683                /* happens for trusted domains without inbound trust */
     1684                return NT_STATUS_TRUSTED_DOMAIN_FAILURE;
     1685        }
     1686
     1687        return NT_STATUS_OK;
    16751688}
    16761689
     
    17701783                        domain->initialized = True;
    17711784
    1772                         if ( !winbindd_can_contact_domain( domain) )
    1773                                 domain->internal = True;
    1774 
    17751785                        break;
    17761786                }               
     
    20242034        char *domain_name = NULL;
    20252035
    2026         result = init_dc_connection(domain);
     2036        result = init_dc_connection_rpc(domain);
    20272037        if (!NT_STATUS_IS_OK(result)) {
    20282038                return result;
     
    20312041        conn = &domain->conn;
    20322042
    2033         if (conn->samr_pipe != NULL) {
     2043        if (rpccli_is_connected(conn->samr_pipe)) {
    20342044                goto done;
    20352045        }
    20362046
     2047        TALLOC_FREE(conn->samr_pipe);
    20372048
    20382049        /*
     
    22062217        DEBUG(10,("cm_connect_lsa_tcp\n"));
    22072218
    2208         status = init_dc_connection(domain);
     2219        status = init_dc_connection_rpc(domain);
    22092220        if (!NT_STATUS_IS_OK(status)) {
    22102221                return status;
     
    22162227            conn->lsa_pipe_tcp->transport->transport == NCACN_IP_TCP &&
    22172228            conn->lsa_pipe_tcp->auth->auth_level == DCERPC_AUTH_LEVEL_PRIVACY &&
    2218             rpc_pipe_tcp_connection_ok(conn->lsa_pipe_tcp)) {
     2229            rpccli_is_connected(conn->lsa_pipe_tcp)) {
    22192230                goto done;
    22202231        }
     
    22522263        struct netlogon_creds_CredentialState *p_creds;
    22532264
    2254         result = init_dc_connection(domain);
     2265        result = init_dc_connection_rpc(domain);
    22552266        if (!NT_STATUS_IS_OK(result))
    22562267                return result;
     
    22582269        conn = &domain->conn;
    22592270
    2260         if (conn->lsa_pipe != NULL) {
     2271        if (rpccli_is_connected(conn->lsa_pipe)) {
    22612272                goto done;
    22622273        }
     2274
     2275        TALLOC_FREE(conn->lsa_pipe);
    22632276
    22642277        if ((conn->cli->user_name[0] == '\0') ||
     
    23822395        *cli = NULL;
    23832396
    2384         result = init_dc_connection(domain);
     2397        result = init_dc_connection_rpc(domain);
    23852398        if (!NT_STATUS_IS_OK(result)) {
    23862399                return result;
     
    23892402        conn = &domain->conn;
    23902403
    2391         if (conn->netlogon_pipe != NULL) {
     2404        if (rpccli_is_connected(conn->netlogon_pipe)) {
    23922405                *cli = conn->netlogon_pipe;
    23932406                return NT_STATUS_OK;
    23942407        }
     2408
     2409        TALLOC_FREE(conn->netlogon_pipe);
    23952410
    23962411        result = cli_rpc_pipe_open_noauth(conn->cli,
     
    24722487                          "was %s\n", nt_errstr(result)));
    24732488
    2474                 /* make sure we return something besides OK */
    2475                 return !NT_STATUS_IS_OK(result) ? result : NT_STATUS_PIPE_NOT_AVAILABLE;
     2489                invalidate_cm_connection(conn);
     2490                return result;
    24762491        }
    24772492
Note: See TracChangeset for help on using the changeset viewer.