Changeset 427 for vendor/current/source3/winbindd
- Timestamp:
- Apr 9, 2010, 3:20:58 PM (15 years ago)
- Location:
- vendor/current/source3/winbindd
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/winbindd/wb_next_grent.c
r414 r427 50 50 state->gstate = gstate; 51 51 state->gr = gr; 52 state->max_nesting = max_nesting; 52 53 53 54 if (state->gstate->next_group >= state->gstate->num_groups) { -
vendor/current/source3/winbindd/winbindd.c
r414 r427 571 571 state->pid = state->request->pid; 572 572 573 state->cmd_name = "unknown request"; 574 state->recv_fn = NULL; 575 573 576 /* Process command */ 574 577 … … 591 594 struct tevent_req *req; 592 595 593 DEBUG(10, ("process_request: Handling async request %s\n", 594 atable->cmd_name)); 596 state->cmd_name = atable->cmd_name; 597 state->recv_fn = atable->recv_req; 598 599 DEBUG(10, ("process_request: Handling async request %d:%s\n", 600 (int)state->pid, state->cmd_name)); 595 601 596 602 req = atable->send_req(state->mem_ctx, winbind_event_context(), … … 603 609 } 604 610 tevent_req_set_callback(req, wb_request_done, state); 605 state->recv_fn = atable->recv_req;606 611 return; 607 612 } … … 621 626 DEBUG(10,("process_request: request fn %s\n", 622 627 table->winbindd_cmd_name )); 628 state->cmd_name = table->winbindd_cmd_name; 623 629 table->fn(state); 624 630 break; … … 639 645 NTSTATUS status; 640 646 641 state->response = talloc_zero(state, struct winbindd_response); 647 state->response = talloc_zero(state->mem_ctx, 648 struct winbindd_response); 642 649 if (state->response == NULL) { 650 DEBUG(0, ("wb_request_done[%d:%s]: talloc_zero failed - removing client\n", 651 (int)state->pid, state->cmd_name)); 643 652 remove_client(state); 644 653 return; … … 649 658 status = state->recv_fn(req, state->response); 650 659 TALLOC_FREE(req); 660 661 DEBUG(10,("wb_request_done[%d:%s]: %s\n", 662 (int)state->pid, state->cmd_name, nt_errstr(status))); 663 651 664 if (!NT_STATUS_IS_OK(status)) { 652 DEBUG(10, ("returning %s\n", nt_errstr(status)));653 665 request_error(state); 654 666 return; … … 682 694 state->response); 683 695 if (req == NULL) { 696 DEBUG(10,("request_finished[%d:%s]: wb_resp_write_send() failed\n", 697 (int)state->pid, state->cmd_name)); 684 698 remove_client(state); 685 699 return; … … 700 714 close(state->sock); 701 715 state->sock = -1; 702 DEBUG(2, ("Could not write response to client: %s\n",703 strerror(err)));716 DEBUG(2, ("Could not write response[%d:%s] to client: %s\n", 717 (int)state->pid, state->cmd_name, strerror(err))); 704 718 remove_client(state); 705 719 return; 706 720 } 721 722 DEBUG(10,("winbind_client_response_written[%d:%s]: deliverd response to client\n", 723 (int)state->pid, state->cmd_name)); 707 724 708 725 TALLOC_FREE(state->mem_ctx); 709 726 state->response = NULL; 727 state->cmd_name = "no request"; 728 state->recv_fn = NULL; 710 729 711 730 req = wb_req_read_send(state, winbind_event_context(), state->sock, -
vendor/current/source3/winbindd/winbindd.h
r414 r427 57 57 58 58 TALLOC_CTX *mem_ctx; /* memory per request */ 59 const char *cmd_name; 59 60 NTSTATUS (*recv_fn)(struct tevent_req *req, 60 61 struct winbindd_response *presp); -
vendor/current/source3/winbindd/winbindd_cm.c
r414 r427 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 -
vendor/current/source3/winbindd/winbindd_dual.c
r414 r427 1464 1464 maxfd = state.sock; 1465 1465 1466 /* 1467 * Initialize this high as event_add_to_select_args() 1468 * uses a timeval_min() on this and next_event. Fix 1469 * from Roel van Meer <rolek@alt001.com>. 1470 */ 1471 t.tv_sec = 999999; 1472 t.tv_usec = 0; 1473 1466 1474 event_add_to_select_args(winbind_event_context(), &now, 1467 1475 &r_fds, &w_fds, &t, &maxfd); -
vendor/current/source3/winbindd/winbindd_pam.c
r414 r427 1361 1361 our connection. */ 1362 1362 1363 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL)) {1363 if (!rpccli_is_connected(netlogon_pipe)) { 1364 1364 retry = true; 1365 1365 continue; … … 1936 1936 our connection. */ 1937 1937 1938 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL)) {1938 if (!rpccli_is_connected(netlogon_pipe)) { 1939 1939 retry = true; 1940 1940 continue; -
vendor/current/source3/winbindd/winbindd_reconnect.c
r414 r427 28 28 extern struct winbindd_methods msrpc_methods; 29 29 30 static bool reconnect_need_retry(NTSTATUS status) 31 { 32 if (NT_STATUS_IS_OK(status)) { 33 return false; 34 } 35 36 if (!NT_STATUS_IS_ERR(status)) { 37 return false; 38 } 39 40 if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) { 41 return false; 42 } 43 44 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)) { 45 return false; 46 } 47 48 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_GROUP)) { 49 return false; 50 } 51 52 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_ALIAS)) { 53 return false; 54 } 55 56 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_MEMBER)) { 57 return false; 58 } 59 60 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_DOMAIN)) { 61 return false; 62 } 63 64 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_PRIVILEGE)) { 65 return false; 66 } 67 68 if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MEMORY)) { 69 return false; 70 } 71 72 return true; 73 } 74 30 75 /* List all users */ 31 76 static NTSTATUS query_user_list(struct winbindd_domain *domain, … … 39 84 num_entries, info); 40 85 41 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))86 if (reconnect_need_retry(result)) 42 87 result = msrpc_methods.query_user_list(domain, mem_ctx, 43 88 num_entries, info); … … 56 101 num_entries, info); 57 102 58 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))103 if (reconnect_need_retry(result)) 59 104 result = msrpc_methods.enum_dom_groups(domain, mem_ctx, 60 105 num_entries, info); … … 74 119 num_entries, info); 75 120 76 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))121 if (reconnect_need_retry(result)) 77 122 result = msrpc_methods.enum_local_groups(domain, mem_ctx, 78 123 num_entries, info); … … 95 140 flags, sid, type); 96 141 97 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))142 if (reconnect_need_retry(result)) 98 143 result = msrpc_methods.name_to_sid(domain, mem_ctx, 99 144 domain_name, name, flags, … … 118 163 domain_name, name, type); 119 164 120 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))165 if (reconnect_need_retry(result)) 121 166 result = msrpc_methods.sid_to_name(domain, mem_ctx, sid, 122 167 domain_name, name, type); … … 139 184 rids, num_rids, 140 185 domain_name, names, types); 141 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL)) {186 if (reconnect_need_retry(result)) { 142 187 result = msrpc_methods.rids_to_names(domain, mem_ctx, sid, 143 188 rids, num_rids, … … 160 205 user_info); 161 206 162 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))207 if (reconnect_need_retry(result)) 163 208 result = msrpc_methods.query_user(domain, mem_ctx, user_sid, 164 209 user_info); … … 179 224 user_gids); 180 225 181 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))226 if (reconnect_need_retry(result)) 182 227 result = msrpc_methods.lookup_usergroups(domain, mem_ctx, 183 228 user_sid, num_groups, … … 199 244 alias_rids); 200 245 201 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))246 if (reconnect_need_retry(result)) 202 247 result = msrpc_methods.lookup_useraliases(domain, mem_ctx, 203 248 num_sids, sids, … … 224 269 name_types); 225 270 226 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))271 if (reconnect_need_retry(result)) 227 272 result = msrpc_methods.lookup_groupmem(domain, mem_ctx, 228 273 group_sid, type, … … 241 286 result = msrpc_methods.sequence_number(domain, seq); 242 287 243 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))288 if (reconnect_need_retry(result)) 244 289 result = msrpc_methods.sequence_number(domain, seq); 245 290 … … 256 301 result = msrpc_methods.lockout_policy(domain, mem_ctx, policy); 257 302 258 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))303 if (reconnect_need_retry(result)) 259 304 result = msrpc_methods.lockout_policy(domain, mem_ctx, policy); 260 305 … … 271 316 result = msrpc_methods.password_policy(domain, mem_ctx, policy); 272 317 273 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))318 if (reconnect_need_retry(result)) 274 319 result = msrpc_methods.password_policy(domain, mem_ctx, policy); 275 320 … … 286 331 result = msrpc_methods.trusted_domains(domain, mem_ctx, trusts); 287 332 288 if ( NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))333 if (reconnect_need_retry(result)) 289 334 result = msrpc_methods.trusted_domains(domain, mem_ctx, 290 335 trusts);
Note:
See TracChangeset
for help on using the changeset viewer.