Changeset 429 for trunk/server/source3/winbindd/winbindd_cm.c
- Timestamp:
- Apr 9, 2010, 3:51:41 PM (15 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
-
Property svn:mergeinfo
set to
/vendor/3.5.2 merged eligible /vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/server/source3/winbindd/winbindd_cm.c
r414 r429 1607 1607 static bool connection_ok(struct winbindd_domain *domain) 1608 1608 { 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", 1624 1614 domain->dcname, domain->name)); 1625 1615 return False; … … 1647 1637 } 1648 1638 1639 if (!winbindd_can_contact_domain(domain)) { 1640 invalidate_cm_connection(&domain->conn); 1641 domain->initialized = True; 1642 return NT_STATUS_OK; 1643 } 1644 1649 1645 if (connection_ok(domain)) { 1650 1646 if (!domain->initialized) { … … 1673 1669 1674 1670 return init_dc_connection_network(domain); 1671 } 1672 1673 static 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; 1675 1688 } 1676 1689 … … 1770 1783 domain->initialized = True; 1771 1784 1772 if ( !winbindd_can_contact_domain( domain) )1773 domain->internal = True;1774 1775 1785 break; 1776 1786 } … … 2024 2034 char *domain_name = NULL; 2025 2035 2026 result = init_dc_connection (domain);2036 result = init_dc_connection_rpc(domain); 2027 2037 if (!NT_STATUS_IS_OK(result)) { 2028 2038 return result; … … 2031 2041 conn = &domain->conn; 2032 2042 2033 if ( conn->samr_pipe != NULL) {2043 if (rpccli_is_connected(conn->samr_pipe)) { 2034 2044 goto done; 2035 2045 } 2036 2046 2047 TALLOC_FREE(conn->samr_pipe); 2037 2048 2038 2049 /* … … 2206 2217 DEBUG(10,("cm_connect_lsa_tcp\n")); 2207 2218 2208 status = init_dc_connection (domain);2219 status = init_dc_connection_rpc(domain); 2209 2220 if (!NT_STATUS_IS_OK(status)) { 2210 2221 return status; … … 2216 2227 conn->lsa_pipe_tcp->transport->transport == NCACN_IP_TCP && 2217 2228 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)) { 2219 2230 goto done; 2220 2231 } … … 2252 2263 struct netlogon_creds_CredentialState *p_creds; 2253 2264 2254 result = init_dc_connection (domain);2265 result = init_dc_connection_rpc(domain); 2255 2266 if (!NT_STATUS_IS_OK(result)) 2256 2267 return result; … … 2258 2269 conn = &domain->conn; 2259 2270 2260 if ( conn->lsa_pipe != NULL) {2271 if (rpccli_is_connected(conn->lsa_pipe)) { 2261 2272 goto done; 2262 2273 } 2274 2275 TALLOC_FREE(conn->lsa_pipe); 2263 2276 2264 2277 if ((conn->cli->user_name[0] == '\0') || … … 2382 2395 *cli = NULL; 2383 2396 2384 result = init_dc_connection (domain);2397 result = init_dc_connection_rpc(domain); 2385 2398 if (!NT_STATUS_IS_OK(result)) { 2386 2399 return result; … … 2389 2402 conn = &domain->conn; 2390 2403 2391 if ( conn->netlogon_pipe != NULL) {2404 if (rpccli_is_connected(conn->netlogon_pipe)) { 2392 2405 *cli = conn->netlogon_pipe; 2393 2406 return NT_STATUS_OK; 2394 2407 } 2408 2409 TALLOC_FREE(conn->netlogon_pipe); 2395 2410 2396 2411 result = cli_rpc_pipe_open_noauth(conn->cli, … … 2472 2487 "was %s\n", nt_errstr(result))); 2473 2488 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; 2476 2491 } 2477 2492
Note:
See TracChangeset
for help on using the changeset viewer.