Ignore:
Timestamp:
Mar 11, 2009, 9:14:55 AM (16 years ago)
Author:
Paul Smedley
Message:

Add 'missing' 3.0.34 diffs

File:
1 edited

Legend:

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

    r140 r165  
    162162****************************************************************/
    163163
     164bool winbindd_reinit_after_fork(const char *logfile);
     165
    164166static BOOL fork_child_dc_connect(struct winbindd_domain *domain)
    165167{
     
    169171        pid_t child_pid;
    170172        pid_t parent_pid = sys_getpid();
     173        pstring logfile;
    171174
    172175        /* Stop zombies */
     
    198201
    199202        /* tdb needs special fork handling */
    200         if (tdb_reopen_all(1) == -1) {
    201                 DEBUG(0,("tdb_reopen_all failed.\n"));
     203        if (!override_logfile) {
     204                pstr_sprintf(logfile, "%s/log.winbindd-dc-connect", dyn_LOGFILEBASE);
     205        }
     206        if (!winbindd_reinit_after_fork(logfile)) {
     207                DEBUG(0,("winbindd_reinit_after_fork failed.\n"));
     208                message_send_pid(pid_to_procid(parent_pid), MSG_WINBIND_FAILED_TO_GO_ONLINE,
     209                                domain->name,
     210                                strlen(domain->name)+1, False);
    202211                _exit(0);
    203         }
    204 
    205         close_conns_after_fork();
    206 
    207         if (!override_logfile) {
    208                 pstring logfile;
    209                 pstr_sprintf(logfile, "%s/log.winbindd-dc-connect", dyn_LOGFILEBASE);
    210                 lp_set_logfile(logfile);
    211                 reopen_logs();
    212212        }
    213213
     
    352352****************************************************************/
    353353
     354void ccache_regain_all_now(void);
     355
    354356static void set_domain_online(struct winbindd_domain *domain)
    355357{
    356         struct timeval now;
    357 
    358358        DEBUG(10,("set_domain_online: called for domain %s\n",
    359359                domain->name ));
     
    372372
    373373        /* If we are waiting to get a krb5 ticket, trigger immediately. */
    374         GetTimeOfDay(&now);
    375         set_event_dispatch_time(winbind_event_context(),
    376                                 "krb5_ticket_gain_handler", now);
     374        ccache_regain_all_now();
    377375
    378376        /* Ok, we're out of any startup mode now... */
     
    427425           because network manager seems to lie.
    428426           Wait at least 5 seconds. Heuristics suck... */
     427        GetTimeOfDay(&tev);
     428
     429        /* Go into "startup" mode again. */
     430        domain->startup_time = tev.tv_sec;
     431        domain->startup = True;
     432
     433        tev.tv_sec += 5;
    429434
    430435        if (!domain->check_online_event) {
     
    437442                        domain->name ));
    438443
    439                 domain->check_online_event = event_add_timed(winbind_event_context(),
    440                                                                 NULL,
    441                                                                 timeval_current_ofs(5, 0),
    442                                                                 "check_domain_online_handler",
    443                                                                 check_domain_online_handler,
    444                                                                 domain);
    445 
    446                 /* The above *has* to succeed for winbindd to work. */
    447                 if (!domain->check_online_event) {
    448                         smb_panic("set_domain_online_request: failed to add online handler.\n");
    449                 }
    450         }
    451 
    452         GetTimeOfDay(&tev);
    453 
    454         /* Go into "startup" mode again. */
    455         domain->startup_time = tev.tv_sec;
    456         domain->startup = True;
    457 
    458         tev.tv_sec += 5;
    459 
    460         set_event_dispatch_time(winbind_event_context(), "check_domain_online_handler", tev);
     444        }
     445        TALLOC_FREE(domain->check_online_event);
     446       
     447        domain->check_online_event = event_add_timed(winbind_event_context(),
     448                                                        NULL,
     449                                                        tev,
     450                                                        "check_domain_online_handler",
     451                                                        check_domain_online_handler,
     452                                                        domain);
     453
     454        /* The above *has* to succeed for winbindd to work. */
     455        if (!domain->check_online_event) {
     456                smb_panic("set_domain_online_request: failed to add online handler.\n");
     457        }
    461458}
    462459
Note: See TracChangeset for help on using the changeset viewer.