Ignore:
Timestamp:
May 27, 2009, 9:09:42 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/winbindd/winbindd_cm.c

    r228 r232  
    174174        pid_t child_pid;
    175175        pid_t parent_pid = sys_getpid();
     176        char *lfile = NULL;
    176177
    177178        /* Stop zombies */
     
    200201        /* Leave messages blocked - we will never process one. */
    201202
    202         if (!reinit_after_fork(winbind_messaging_context(), true)) {
     203        if (!override_logfile) {
     204                if (asprintf(&lfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) == -1) {
     205                        DEBUG(0, ("fork_child_dc_connect: out of memory!\n"));
     206                        _exit(1);
     207                }
     208        }
     209
     210        if (!winbindd_reinit_after_fork(lfile)) {
    203211                DEBUG(0,("reinit_after_fork() failed\n"));
    204                 _exit(0);
    205         }
    206 
    207         close_conns_after_fork();
    208 
    209         if (!override_logfile) {
    210                 char *logfile;
    211                 if (asprintf(&logfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) > 0) {
    212                         lp_set_logfile(logfile);
    213                         SAFE_FREE(logfile);
    214                         reopen_logs();
    215                 }
    216         }
     212                messaging_send_buf(winbind_messaging_context(),
     213                                   pid_to_procid(parent_pid),
     214                                   MSG_WINBIND_FAILED_TO_GO_ONLINE,
     215                                   (uint8 *)domain->name,
     216                                   strlen(domain->name) + 1);
     217                _exit(1);
     218        }
     219
     220        SAFE_FREE(lfile);
    217221
    218222        mem_ctx = talloc_init("fork_child_dc_connect");
    219223        if (!mem_ctx) {
    220224                DEBUG(0,("talloc_init failed.\n"));
    221                 _exit(0);
     225                _exit(1);
    222226        }
    223227
     
    378382****************************************************************/
    379383
     384void ccache_regain_all_now(void);
     385
    380386static void set_domain_online(struct winbindd_domain *domain)
    381387{
    382         struct timeval now;
    383388
    384389        DEBUG(10,("set_domain_online: called for domain %s\n",
     
    400405
    401406        /* If we are waiting to get a krb5 ticket, trigger immediately. */
    402         GetTimeOfDay(&now);
    403         set_event_dispatch_time(winbind_event_context(),
    404                                 "krb5_ticket_gain_handler", now);
    405 
     407        ccache_regain_all_now();
     408       
    406409        /* Ok, we're out of any startup mode now... */
    407410        domain->startup = False;
     
    475478           Wait at least 5 seconds. Heuristics suck... */
    476479
     480        GetTimeOfDay(&tev);
     481
     482        /* Go into "startup" mode again. */
     483        domain->startup_time = tev.tv_sec;
     484        domain->startup = True;
     485
     486        tev.tv_sec += 5;
    477487        if (!domain->check_online_event) {
    478488                /* If we've come from being globally offline we
     
    480490                   We need to add one now we're trying to go
    481491                   back online. */
    482 
    483492                DEBUG(10,("set_domain_online_request: domain %s was globally offline.\n",
    484493                        domain->name ));
    485 
    486                 domain->check_online_event = event_add_timed(winbind_event_context(),
    487                                                                 NULL,
    488                                                                 timeval_current_ofs(5, 0),
    489                                                                 "check_domain_online_handler",
    490                                                                 check_domain_online_handler,
    491                                                                 domain);
    492 
    493                 /* The above *has* to succeed for winbindd to work. */
    494                 if (!domain->check_online_event) {
    495                         smb_panic("set_domain_online_request: failed to add online handler");
    496                 }
    497         }
    498 
    499         GetTimeOfDay(&tev);
    500 
    501         /* Go into "startup" mode again. */
    502         domain->startup_time = tev.tv_sec;
    503         domain->startup = True;
    504 
    505         tev.tv_sec += 5;
    506 
    507         set_event_dispatch_time(winbind_event_context(), "check_domain_online_handler", tev);
     494        }
     495       
     496        TALLOC_FREE(domain->check_online_event);
     497       
     498        domain->check_online_event = event_add_timed(winbind_event_context(),
     499                                                        NULL,
     500                                                        tev,
     501                                                        "check_domain_online_handler",
     502                                                        check_domain_online_handler,
     503                                                        domain);
     504       
     505        /* The above *has* to succeed for winbindd to work. */
     506        if (!domain->check_online_event) {
     507                smb_panic("set_domain_online_request: failed to add online handler");
     508        }
    508509}
    509510
     
    613614                                                  &domain_info,
    614615                                                  &werr);
    615                 if (W_ERROR_IS_OK(werr)) {
     616                if (NT_STATUS_IS_OK(result) && W_ERROR_IS_OK(werr)) {
    616617                        tmp = talloc_strdup(
    617618                                mem_ctx, domain_info->dc_unc);
Note: See TracChangeset for help on using the changeset viewer.