Changeset 862 for trunk/server/source3/winbindd/winbindd_cm.c
- Timestamp:
- May 13, 2014, 11:39:04 AM (11 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 860
- Property svn:mergeinfo changed
-
trunk/server/source3/winbindd/winbindd_cm.c
r751 r862 338 338 } 339 339 340 void winbind_msg_domain_offline(struct messaging_context *msg_ctx, 341 void *private_data, 342 uint32_t msg_type, 343 struct server_id server_id, 344 DATA_BLOB *data) 345 { 346 const char *domain_name = (const char *)data->data; 347 struct winbindd_domain *domain; 348 349 domain = find_domain_from_name_noinit(domain_name); 350 if (domain == NULL) { 351 return; 352 } 353 354 domain->online = false; 355 356 DEBUG(10, ("Domain %s is marked as offline now.\n", 357 domain_name)); 358 } 359 360 void winbind_msg_domain_online(struct messaging_context *msg_ctx, 361 void *private_data, 362 uint32_t msg_type, 363 struct server_id server_id, 364 DATA_BLOB *data) 365 { 366 const char *domain_name = (const char *)data->data; 367 struct winbindd_domain *domain; 368 369 domain = find_domain_from_name_noinit(domain_name); 370 if (domain == NULL) { 371 return; 372 } 373 374 domain->online = true; 375 376 DEBUG(10, ("Domain %s is marked as online now.\n", 377 domain_name)); 378 } 379 340 380 /**************************************************************** 341 381 Set domain offline and also add handler to put us back online … … 345 385 void set_domain_offline(struct winbindd_domain *domain) 346 386 { 387 pid_t parent_pid = getppid(); 388 347 389 DEBUG(10,("set_domain_offline: called for domain %s\n", 348 390 domain->name )); … … 391 433 DEBUG(10,("set_domain_offline: added event handler for domain %s\n", 392 434 domain->name )); 435 436 /* Send a message to the parent that the domain is offline. */ 437 if (parent_pid > 1 && !domain->internal) { 438 messaging_send_buf(winbind_messaging_context(), 439 pid_to_procid(parent_pid), 440 MSG_WINBIND_DOMAIN_OFFLINE, 441 (uint8 *)domain->name, 442 strlen(domain->name) + 1); 443 } 393 444 394 445 /* Send an offline message to the idmap child when our … … 416 467 static void set_domain_online(struct winbindd_domain *domain) 417 468 { 469 pid_t parent_pid = getppid(); 470 418 471 DEBUG(10,("set_domain_online: called for domain %s\n", 419 472 domain->name )); … … 466 519 467 520 domain->online = True; 521 522 /* Send a message to the parent that the domain is online. */ 523 if (parent_pid > 1 && !domain->internal) { 524 messaging_send_buf(winbind_messaging_context(), 525 pid_to_procid(parent_pid), 526 MSG_WINBIND_DOMAIN_ONLINE, 527 (uint8 *)domain->name, 528 strlen(domain->name) + 1); 529 } 468 530 469 531 /* Send an online message to the idmap child when our … … 1024 1086 result = cli_set_domain((*cli), domain->name); 1025 1087 if (!NT_STATUS_IS_OK(result)) { 1088 SAFE_FREE(ipc_username); 1089 SAFE_FREE(ipc_domain); 1090 SAFE_FREE(ipc_password); 1026 1091 return result; 1027 1092 } … … 1603 1668 result = cm_prepare_connection(domain, fd, domain->dcname, 1604 1669 &new_conn->cli, &retry); 1670 if (!NT_STATUS_IS_OK(result)) { 1671 /* Don't leak the smb connection socket */ 1672 close(fd); 1673 } 1605 1674 1606 1675 if (!retry) … … 2565 2634 2566 2635 /**************************************************************************** 2636 Open a LSA connection to a DC, suiteable for LSA lookup calls. 2637 ****************************************************************************/ 2638 2639 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain, 2640 TALLOC_CTX *mem_ctx, 2641 struct rpc_pipe_client **cli, 2642 struct policy_handle *lsa_policy) 2643 { 2644 NTSTATUS status; 2645 2646 if (domain->can_do_ncacn_ip_tcp) { 2647 status = cm_connect_lsa_tcp(domain, mem_ctx, cli); 2648 if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) || 2649 NT_STATUS_EQUAL(status, NT_STATUS_RPC_SEC_PKG_ERROR) || 2650 NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) { 2651 invalidate_cm_connection(&domain->conn); 2652 status = cm_connect_lsa_tcp(domain, mem_ctx, cli); 2653 } 2654 if (NT_STATUS_IS_OK(status)) { 2655 return status; 2656 } 2657 2658 /* 2659 * we tried twice to connect via ncan_ip_tcp and schannel and 2660 * failed - maybe it is a trusted domain we can't connect to ? 2661 * do not try tcp next time - gd 2662 */ 2663 domain->can_do_ncacn_ip_tcp = false; 2664 } 2665 2666 status = cm_connect_lsa(domain, mem_ctx, cli, lsa_policy); 2667 2668 return status; 2669 } 2670 2671 /**************************************************************************** 2567 2672 Open the netlogon pipe to this DC. Use schannel if specified in client conf. 2568 2673 session key stored in conn->netlogon_pipe->dc->sess_key.
Note:
See TracChangeset
for help on using the changeset viewer.