Revision: 23374 http://trac.macosforge.org/projects/launchd/changeset/23374 Author: zarzycki@apple.com Date: 2007-09-12 17:24:54 -0700 (Wed, 12 Sep 2007) Log Message: ----------- <rdar://problem/5477111> 'ssh localhost sudo launchctl' kills machine Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2007-09-12 19:50:15 UTC (rev 23373) +++ trunk/launchd/src/launchd_core_logic.c 2007-09-13 00:24:54 UTC (rev 23374) @@ -454,6 +454,7 @@ static mach_port_t the_exception_server; static bool did_first_per_user_launchd_BootCache_hack; static jobmgr_t background_jobmgr; +static job_t workaround_5477111; static mach_timebase_info_data_t tbi; /* process wide globals */ @@ -1858,11 +1859,19 @@ void job_mig_destructor(job_t j) { - if (j && j->unload_at_mig_return) { + /* + * 5477111 + * + * 'j' can be invalid at this point. We should fix this up after Leopard ships. + */ + + if (j && j != workaround_5477111 && j->unload_at_mig_return) { job_log(j, LOG_NOTICE, "Unloading PID %u at MIG return.", j->p); job_remove(j); } + workaround_5477111 = NULL; + calendarinterval_sanity_check(); } @@ -5968,6 +5977,8 @@ jm->req_port = 0; jm->jm_port = 0; + workaround_5477111 = j; + jobmgr_shutdown(jm); return BOOTSTRAP_SUCCESS;