Ignore:
Timestamp:
May 23, 2008, 6:56:41 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to 3.0.29

Location:
branches/samba-3.0/source/nsswitch
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/nsswitch/idmap.c

    r124 r134  
    510510
    511511                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 "));
    512582        }
    513583
  • branches/samba-3.0/source/nsswitch/winbindd.c

    r124 r134  
    719719}
    720720
     721/* check if HUP has been received and reload files */
     722void 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 */
     734void winbind_check_sigterm(void)
     735{
     736        if (do_sigterm)
     737                terminate();
     738}
     739
    721740/* Process incoming clients on listen_sock.  We use a tricky non-blocking,
    722741   non-forking, non-threaded model which allows us to handle many
     
    883902        /* Check signal handling things */
    884903
    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();
    895906
    896907        if (do_sigusr2) {
  • branches/samba-3.0/source/nsswitch/winbindd_cache.c

    r71 r134  
    3838extern struct winbindd_methods ads_methods;
    3939#endif
     40extern struct winbindd_methods passdb_methods;
    4041
    4142/*
     
    137138        /* We have to know what type of domain we are dealing with first. */
    138139
     140        if (domain->internal) {
     141                domain->backend = &passdb_methods;
     142                domain->initialized = True;
     143        }
    139144        if ( !domain->initialized ) {
    140145                init_dc_connection( domain );
     
    21182123        /* and save it */
    21192124        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        }
    21212128
    21222129        return status;
  • branches/samba-3.0/source/nsswitch/winbindd_cm.c

    r124 r134  
    721721                                         &machine_krb5_principal);
    722722                if (!NT_STATUS_IS_OK(result)) {
    723                         goto done;
     723                        goto anon_fallback;
    724724                }
    725725
     
    803803                }
    804804        }
     805
     806 anon_fallback:
    805807
    806808        /* Fall back to anonymous connection, this might fail later */
     
    20282030        NTSTATUS result;
    20292031
    2030         uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS;
     2032        uint32 neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
    20312033        uint8  mach_pwd[16];
    20322034        uint32  sec_chan_type;
  • branches/samba-3.0/source/nsswitch/winbindd_dual.c

    r124 r134  
    528528        }
    529529
     530        /* This will be re-added in fork_domain_child() */
     531
     532        DLIST_REMOVE(children, child);
     533       
    530534        remove_fd_event(&child->event);
    531535        close(child->event.fd);
     
    893897        ZERO_STRUCT(state);
    894898        state.pid = sys_getpid();
    895 
    896         /* Stop zombies */
    897         CatchChild();
    898899
    899900        /* Ensure we don't process messages whilst we're
     
    925926        /* Child */
    926927
     928        /* Stop zombies in children */
     929        CatchChild();
     930
    927931        state.sock = fdpair[0];
    928932        close(fdpair[1]);
     
    995999
    9961000        if (child->domain && child->domain->internal && IS_DC) {
    997                 child->domain->internal = False;
    9981001                child->domain->methods = &cache_methods;
    9991002                child->domain->online = False;
     
    10111014                lp_TALLOC_FREE();
    10121015                main_loop_TALLOC_FREE();
     1016
     1017                /* check for signals */
     1018                winbind_check_sigterm();
     1019                winbind_check_sighup();
    10131020
    10141021                run_events(winbind_event_context(), 0, NULL, NULL);
  • branches/samba-3.0/source/nsswitch/winbindd_proto.h

    r30 r134  
    1919void request_ok(struct winbindd_cli_state *state);
    2020void request_finished_cont(void *private_data, BOOL success);
     21void winbind_check_sighup(void);
     22void winbind_check_sigterm(void);
    2123int main(int argc, char **argv, char **envp);
    2224
Note: See TracChangeset for help on using the changeset viewer.