Changeset 232 for branches/samba-3.2.x/source/winbindd/winbindd_cm.c
- Timestamp:
- May 27, 2009, 9:09:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/winbindd/winbindd_cm.c
r228 r232 174 174 pid_t child_pid; 175 175 pid_t parent_pid = sys_getpid(); 176 char *lfile = NULL; 176 177 177 178 /* Stop zombies */ … … 200 201 /* Leave messages blocked - we will never process one. */ 201 202 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)) { 203 211 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); 217 221 218 222 mem_ctx = talloc_init("fork_child_dc_connect"); 219 223 if (!mem_ctx) { 220 224 DEBUG(0,("talloc_init failed.\n")); 221 _exit( 0);225 _exit(1); 222 226 } 223 227 … … 378 382 ****************************************************************/ 379 383 384 void ccache_regain_all_now(void); 385 380 386 static void set_domain_online(struct winbindd_domain *domain) 381 387 { 382 struct timeval now;383 388 384 389 DEBUG(10,("set_domain_online: called for domain %s\n", … … 400 405 401 406 /* 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 406 409 /* Ok, we're out of any startup mode now... */ 407 410 domain->startup = False; … … 475 478 Wait at least 5 seconds. Heuristics suck... */ 476 479 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; 477 487 if (!domain->check_online_event) { 478 488 /* If we've come from being globally offline we … … 480 490 We need to add one now we're trying to go 481 491 back online. */ 482 483 492 DEBUG(10,("set_domain_online_request: domain %s was globally offline.\n", 484 493 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 } 508 509 } 509 510 … … 613 614 &domain_info, 614 615 &werr); 615 if ( W_ERROR_IS_OK(werr)) {616 if (NT_STATUS_IS_OK(result) && W_ERROR_IS_OK(werr)) { 616 617 tmp = talloc_strdup( 617 618 mem_ctx, domain_info->dc_unc);
Note:
See TracChangeset
for help on using the changeset viewer.