Changeset 134 for branches/samba-3.0/source/nsswitch
- Timestamp:
- May 23, 2008, 6:56:41 AM (17 years ago)
- Location:
- branches/samba-3.0/source/nsswitch
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/nsswitch/idmap.c
r124 r134 510 510 511 511 talloc_free(config_option); 512 } 513 514 /* on DCs we need to add idmap_tdb as the default backend if compat is 515 * defined (when the old implicit configuration is used) 516 * This is not done in the previous loop a on member server we exclude 517 * the local domain. But on a DC the local domain is the only domain 518 * available therefore we are left with no default domain */ 519 if (((lp_server_role() == ROLE_DOMAIN_PDC) || 520 (lp_server_role() == ROLE_DOMAIN_BDC)) && 521 ((num_domains == 0) && (compat == 1))) { 522 523 dom = TALLOC_ZERO_P(idmap_ctx, struct idmap_domain); 524 IDMAP_CHECK_ALLOC(dom); 525 526 dom->name = talloc_strdup(dom, "__default__"); 527 IDMAP_CHECK_ALLOC(dom->name); 528 529 dom->default_domain = True; 530 dom->readonly = False; 531 532 /* get the backend methods for this domain */ 533 dom->methods = get_methods(backends, compat_backend); 534 535 if ( ! dom->methods) { 536 ret = smb_probe_module("idmap", compat_backend); 537 if (NT_STATUS_IS_OK(ret)) { 538 dom->methods = get_methods(backends, 539 compat_backend); 540 } 541 } 542 if ( ! dom->methods) { 543 DEBUG(0, ("ERROR: Could not get methods for " 544 "backend %s\n", compat_backend)); 545 ret = NT_STATUS_UNSUCCESSFUL; 546 goto done; 547 } 548 549 /* now that we have methods, 550 * set the destructor for this domain */ 551 talloc_set_destructor(dom, close_domain_destructor); 552 553 dom->params = talloc_strdup(dom, compat_params); 554 IDMAP_CHECK_ALLOC(dom->params); 555 556 /* Finally instance a backend copy for this domain */ 557 ret = dom->methods->init(dom); 558 if ( ! NT_STATUS_IS_OK(ret)) { 559 DEBUG(0, ("ERROR: Initialization failed for backend " 560 "%s (domain %s), deferred!\n", 561 compat_backend, dom->name)); 562 } 563 idmap_domains = talloc_realloc(idmap_ctx, idmap_domains, 564 struct idmap_domain *, 2); 565 if ( ! idmap_domains) { 566 DEBUG(0, ("Out of memory!\n")); 567 ret = NT_STATUS_NO_MEMORY; 568 goto done; 569 } 570 idmap_domains[num_domains] = dom; 571 572 def_dom_num = num_domains; 573 574 /* Bump counter to next available slot */ 575 576 num_domains++; 577 578 DEBUG(10, ("Domain %s - Backend %s - %sdefault - %sreadonly\n", 579 dom->name, compat_backend, 580 dom->default_domain?"":"not ", 581 dom->readonly?"":"not ")); 512 582 } 513 583 -
branches/samba-3.0/source/nsswitch/winbindd.c
r124 r134 719 719 } 720 720 721 /* check if HUP has been received and reload files */ 722 void winbind_check_sighup(void) 723 { 724 if (do_sighup) { 725 726 DEBUG(3, ("got SIGHUP\n")); 727 728 msg_reload_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0, NULL); 729 do_sighup = False; 730 } 731 } 732 733 /* check if TERM has been received */ 734 void winbind_check_sigterm(void) 735 { 736 if (do_sigterm) 737 terminate(); 738 } 739 721 740 /* Process incoming clients on listen_sock. We use a tricky non-blocking, 722 741 non-forking, non-threaded model which allows us to handle many … … 883 902 /* Check signal handling things */ 884 903 885 if (do_sigterm) 886 terminate(); 887 888 if (do_sighup) { 889 890 DEBUG(3, ("got SIGHUP\n")); 891 892 msg_reload_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0, NULL); 893 do_sighup = False; 894 } 904 winbind_check_sigterm(); 905 winbind_check_sighup(); 895 906 896 907 if (do_sigusr2) { -
branches/samba-3.0/source/nsswitch/winbindd_cache.c
r71 r134 38 38 extern struct winbindd_methods ads_methods; 39 39 #endif 40 extern struct winbindd_methods passdb_methods; 40 41 41 42 /* … … 137 138 /* We have to know what type of domain we are dealing with first. */ 138 139 140 if (domain->internal) { 141 domain->backend = &passdb_methods; 142 domain->initialized = True; 143 } 139 144 if ( !domain->initialized ) { 140 145 init_dc_connection( domain ); … … 2118 2123 /* and save it */ 2119 2124 refresh_sequence_number(domain, False); 2120 wcache_save_password_policy(domain, status, policy); 2125 if (NT_STATUS_IS_OK(status)) { 2126 wcache_save_password_policy(domain, status, policy); 2127 } 2121 2128 2122 2129 return status; -
branches/samba-3.0/source/nsswitch/winbindd_cm.c
r124 r134 721 721 &machine_krb5_principal); 722 722 if (!NT_STATUS_IS_OK(result)) { 723 goto done;723 goto anon_fallback; 724 724 } 725 725 … … 803 803 } 804 804 } 805 806 anon_fallback: 805 807 806 808 /* Fall back to anonymous connection, this might fail later */ … … 2028 2030 NTSTATUS result; 2029 2031 2030 uint32 neg_flags = NETLOGON_NEG_ SELECT_AUTH2_FLAGS;2032 uint32 neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS; 2031 2033 uint8 mach_pwd[16]; 2032 2034 uint32 sec_chan_type; -
branches/samba-3.0/source/nsswitch/winbindd_dual.c
r124 r134 528 528 } 529 529 530 /* This will be re-added in fork_domain_child() */ 531 532 DLIST_REMOVE(children, child); 533 530 534 remove_fd_event(&child->event); 531 535 close(child->event.fd); … … 893 897 ZERO_STRUCT(state); 894 898 state.pid = sys_getpid(); 895 896 /* Stop zombies */897 CatchChild();898 899 899 900 /* Ensure we don't process messages whilst we're … … 925 926 /* Child */ 926 927 928 /* Stop zombies in children */ 929 CatchChild(); 930 927 931 state.sock = fdpair[0]; 928 932 close(fdpair[1]); … … 995 999 996 1000 if (child->domain && child->domain->internal && IS_DC) { 997 child->domain->internal = False;998 1001 child->domain->methods = &cache_methods; 999 1002 child->domain->online = False; … … 1011 1014 lp_TALLOC_FREE(); 1012 1015 main_loop_TALLOC_FREE(); 1016 1017 /* check for signals */ 1018 winbind_check_sigterm(); 1019 winbind_check_sighup(); 1013 1020 1014 1021 run_events(winbind_event_context(), 0, NULL, NULL); -
branches/samba-3.0/source/nsswitch/winbindd_proto.h
r30 r134 19 19 void request_ok(struct winbindd_cli_state *state); 20 20 void request_finished_cont(void *private_data, BOOL success); 21 void winbind_check_sighup(void); 22 void winbind_check_sigterm(void); 21 23 int main(int argc, char **argv, char **envp); 22 24
Note:
See TracChangeset
for help on using the changeset viewer.