Revision
23956
Author
lindak@apple.com
Date
2009-11-17 18:38:58 -0800 (Tue, 17 Nov 2009)

Log Message

<rdar://problem/7386864> 11A47: SecurityAgent no longer visible via Accessibility
<rdar://problem/7399539> X2: Dock does not register apps that quit: error -600

Modified Paths

Property Changed

Diff

Property changes: trunk


Modified: svn:mergeinfo

/branches/PR-5898404:23681-23700 /branches/PR-5978442:23651-23701 /branches/PR-6132016:23719-23738 /branches/PR-6271234:23818-23822 /branches/PR-6562592:23812-23822 /branches/PR-6564965:23832-23851 /branches/PR-6589133:23810-23822 /branches/PR-6609410:23828 /branches/PR-7178164:23935-23940 + /branches/PR-5092682:23731-23742 /branches/PR-5898404:23681-23700 /branches/PR-5978442:23651-23701 /branches/PR-6132016:23719-23738 /branches/PR-6271234:23818-23822 /branches/PR-6562592:23812-23822 /branches/PR-6564965:23832-23851 /branches/PR-6589133:23810-23822 /branches/PR-6609410:23828 /branches/PR-7084138:23944-23955 /branches/PR-7178164:23935-23940

Property changes: trunk/launchd/src/bootstrap.h


Modified: svn:mergeinfo

/branches/PR-5978442/launchd/src/libbootstrap_public.h:23651-23701 /branches/PR-6271234/launchd/src/bootstrap.h:23818-23822 /branches/PR-6562592/launchd/src/bootstrap.h:23812-23822 /branches/PR-6564965/launchd/src/bootstrap.h:23832-23851 /branches/PR-6589133/launchd/src/bootstrap.h:23810-23822 /branches/PR-6609410/launchd/src/bootstrap.h:23828 /branches/PR-7178164/launchd/src/bootstrap.h:23935-23940 + /branches/PR-5898404/launchd/src/libbootstrap_public.h:23681-23700 /branches/PR-5978442/launchd/src/libbootstrap_public.h:23651-23701 /branches/PR-6271234/launchd/src/bootstrap.h:23818-23822 /branches/PR-6562592/launchd/src/bootstrap.h:23812-23822 /branches/PR-6564965/launchd/src/bootstrap.h:23832-23851 /branches/PR-6589133/launchd/src/bootstrap.h:23810-23822 /branches/PR-6609410/launchd/src/bootstrap.h:23828 /branches/PR-7084138/launchd/src/bootstrap.h:23944-23955 /branches/PR-7178164/launchd/src/bootstrap.h:23935-23940

Property changes: trunk/launchd/src/bootstrap_priv.h


Modified: svn:mergeinfo

/branches/PR-5978442/launchd/src/libbootstrap_private.h:23651-23701 /branches/PR-6271234/launchd/src/bootstrap_priv.h:23818-23822 /branches/PR-6562592/launchd/src/bootstrap_priv.h:23812-23822 /branches/PR-6564965/launchd/src/bootstrap_priv.h:23832-23851 /branches/PR-6589133/launchd/src/bootstrap_priv.h:23810-23822 /branches/PR-6609410/launchd/src/bootstrap_priv.h:23828 /branches/PR-7178164/launchd/src/bootstrap_priv.h:23935-23940 + /branches/PR-5898404/launchd/src/libbootstrap_private.h:23681-23700 /branches/PR-5978442/launchd/src/libbootstrap_private.h:23651-23701 /branches/PR-6271234/launchd/src/bootstrap_priv.h:23818-23822 /branches/PR-6562592/launchd/src/bootstrap_priv.h:23812-23822 /branches/PR-6564965/launchd/src/bootstrap_priv.h:23832-23851 /branches/PR-6589133/launchd/src/bootstrap_priv.h:23810-23822 /branches/PR-6609410/launchd/src/bootstrap_priv.h:23828 /branches/PR-7084138/launchd/src/bootstrap_priv.h:23944-23955 /branches/PR-7178164/launchd/src/bootstrap_priv.h:23935-23940

Property changes: trunk/launchd/src/launch.h


Modified: svn:mergeinfo

/branches/PR-5978442/launchd/src/liblaunch_public.h:23651-23701 /branches/PR-6271234/launchd/src/launch.h:23818-23822 /branches/PR-6562592/launchd/src/launch.h:23812-23822 /branches/PR-6564965/launchd/src/launch.h:23832-23851 /branches/PR-6589133/launchd/src/launch.h:23810-23822 /branches/PR-6609410/launchd/src/launch.h:23828 /branches/PR-7178164/launchd/src/launch.h:23935-23940 + /branches/PR-5898404/launchd/src/liblaunch_public.h:23681-23700 /branches/PR-5978442/launchd/src/liblaunch_public.h:23651-23701 /branches/PR-6271234/launchd/src/launch.h:23818-23822 /branches/PR-6562592/launchd/src/launch.h:23812-23822 /branches/PR-6564965/launchd/src/launch.h:23832-23851 /branches/PR-6589133/launchd/src/launch.h:23810-23822 /branches/PR-6609410/launchd/src/launch.h:23828 /branches/PR-7084138/launchd/src/launch.h:23944-23955 /branches/PR-7178164/launchd/src/launch.h:23935-23940

Property changes: trunk/launchd/src/launch_internal.h


Modified: svn:mergeinfo

/branches/PR-5978442/launchd/src/liblaunch_internal.h:23651-23701 /branches/PR-6271234/launchd/src/launch_internal.h:23818-23822 /branches/PR-6562592/launchd/src/launch_internal.h:23812-23822 /branches/PR-6564965/launchd/src/launch_internal.h:23832-23851 /branches/PR-6589133/launchd/src/launch_internal.h:23810-23822 /branches/PR-6609410/launchd/src/launch_internal.h:23828 /branches/PR-7178164/launchd/src/launch_internal.h:23935-23940 + /branches/PR-5898404/launchd/src/liblaunch_internal.h:23681-23700 /branches/PR-5978442/launchd/src/liblaunch_internal.h:23651-23701 /branches/PR-6271234/launchd/src/launch_internal.h:23818-23822 /branches/PR-6562592/launchd/src/launch_internal.h:23812-23822 /branches/PR-6564965/launchd/src/launch_internal.h:23832-23851 /branches/PR-6589133/launchd/src/launch_internal.h:23810-23822 /branches/PR-6609410/launchd/src/launch_internal.h:23828 /branches/PR-7084138/launchd/src/launch_internal.h:23944-23955 /branches/PR-7178164/launchd/src/launch_internal.h:23935-23940

Property changes: trunk/launchd/src/launch_priv.h


Modified: svn:mergeinfo

/branches/PR-5978442/launchd/src/liblaunch_private.h:23651-23701 /branches/PR-6271234/launchd/src/launch_priv.h:23818-23822 /branches/PR-6562592/launchd/src/launch_priv.h:23812-23822 /branches/PR-6564965/launchd/src/launch_priv.h:23832-23851 /branches/PR-6589133/launchd/src/launch_priv.h:23810-23822 /branches/PR-6609410/launchd/src/launch_priv.h:23828 /branches/PR-7178164/launchd/src/launch_priv.h:23935-23940 + /branches/PR-5898404/launchd/src/liblaunch_private.h:23681-23700 /branches/PR-5978442/launchd/src/liblaunch_private.h:23651-23701 /branches/PR-6271234/launchd/src/launch_priv.h:23818-23822 /branches/PR-6562592/launchd/src/launch_priv.h:23812-23822 /branches/PR-6564965/launchd/src/launch_priv.h:23832-23851 /branches/PR-6589133/launchd/src/launch_priv.h:23810-23822 /branches/PR-6609410/launchd/src/launch_priv.h:23828 /branches/PR-7084138/launchd/src/launch_priv.h:23944-23955 /branches/PR-7178164/launchd/src/launch_priv.h:23935-23940

Modified: trunk/launchd/src/launchd_core_logic.c (23955 => 23956)


--- trunk/launchd/src/launchd_core_logic.c	2009-11-18 01:18:55 UTC (rev 23955)
+++ trunk/launchd/src/launchd_core_logic.c	2009-11-18 02:38:58 UTC (rev 23956)
@@ -8608,7 +8608,7 @@
 		job_handle_mpm_wait(NULL, MACH_PORT_NULL, NULL);
 	}
 	struct ldcred *ldc = runtime_get_caller_creds();
-	job_t calling_j = job_mig_intran2(j->mgr, MACH_PORT_NULL, ldc->pid);
+	job_t calling_j = jobmgr_find_by_pid(j->mgr, ldc->pid, true);
 	
 	return job_mig_wait2(calling_j, j, srp, waitstatus, true);
 #endif
@@ -8627,7 +8627,17 @@
 		return BOOTSTRAP_NO_MEMORY;
 	}
 	
-	if( target_j->p == 0 ) {
+	/* See rdar://problem/7084138 for why we do the second part of this check.
+	 * Basically, since Finder, Dock and SystemUIServer are now real launchd
+	 * jobs, they don't get removed after exiting, like legacy LaunchServices
+	 * jobs do. So there's a race. coreservicesd came in asking for the exit
+	 * status after we'd relaunched Finder, so Finder's PID isn't 0.
+	 *
+	 * So we check to make sure the target job isn't a LaunchServices job and
+	 * that the request is coming through the legacy path (mpm_wait()). If so,
+	 * we return the last exit status, regardless of the current PID value.
+	 */
+	if( target_j->p == 0 || (!target_j->legacy_LS_job && legacy) ) {
 		*status = target_j->last_exit_status;
 		return BOOTSTRAP_SUCCESS;
 	}

Property changes: trunk/launchd/src/protocol_vproc.defs


Modified: svn:mergeinfo

/branches/PR-5898404/launchd/src/protocol_job.defs:23681-23700 /branches/PR-5978442/launchd/src/protocol_job.defs:23651-23701 /branches/PR-6132016/launchd/src/protocol_job.defs:23719-23738 /branches/PR-6271234/launchd/src/protocol_vproc.defs:23818-23822 /branches/PR-6562592/launchd/src/protocol_vproc.defs:23812-23822 /branches/PR-6564965/launchd/src/protocol_vproc.defs:23832-23851 /branches/PR-6589133/launchd/src/protocol_vproc.defs:23810-23822 /branches/PR-6609410/launchd/src/protocol_vproc.defs:23828 /branches/PR-7178164/launchd/src/protocol_vproc.defs:23935-23940 + /branches/PR-5092682/launchd/src/protocol_job.defs:23731-23742 /branches/PR-5898404/launchd/src/protocol_job.defs:23681-23700 /branches/PR-5978442/launchd/src/protocol_job.defs:23651-23701 /branches/PR-6132016/launchd/src/protocol_job.defs:23719-23738 /branches/PR-6271234/launchd/src/protocol_vproc.defs:23818-23822 /branches/PR-6562592/launchd/src/protocol_vproc.defs:23812-23822 /branches/PR-6564965/launchd/src/protocol_vproc.defs:23832-23851 /branches/PR-6589133/launchd/src/protocol_vproc.defs:23810-23822 /branches/PR-6609410/launchd/src/protocol_vproc.defs:23828 /branches/PR-7084138/launchd/src/protocol_vproc.defs:23944-23955 /branches/PR-7178164/launchd/src/protocol_vproc.defs:23935-23940

Property changes: trunk/launchd/src/vproc.h


Modified: svn:mergeinfo

/branches/PR-5898404/launchd/src/libvproc_public.h:23681-23700 /branches/PR-5978442/launchd/src/libvproc_public.h:23651-23701 /branches/PR-6132016/launchd/src/libvproc_public.h:23719-23738 /branches/PR-6271234/launchd/src/vproc.h:23818-23822 /branches/PR-6562592/launchd/src/vproc.h:23812-23822 /branches/PR-6564965/launchd/src/vproc.h:23832-23851 /branches/PR-6589133/launchd/src/vproc.h:23810-23822 /branches/PR-6609410/launchd/src/vproc.h:23828 /branches/PR-7178164/launchd/src/vproc.h:23935-23940 + /branches/PR-5092682/launchd/src/libvproc_public.h:23731-23742 /branches/PR-5898404/launchd/src/libvproc_public.h:23681-23700 /branches/PR-5978442/launchd/src/libvproc_public.h:23651-23701 /branches/PR-6132016/launchd/src/libvproc_public.h:23719-23738 /branches/PR-6271234/launchd/src/vproc.h:23818-23822 /branches/PR-6562592/launchd/src/vproc.h:23812-23822 /branches/PR-6564965/launchd/src/vproc.h:23832-23851 /branches/PR-6589133/launchd/src/vproc.h:23810-23822 /branches/PR-6609410/launchd/src/vproc.h:23828 /branches/PR-7084138/launchd/src/vproc.h:23944-23955 /branches/PR-7178164/launchd/src/vproc.h:23935-23940

Property changes: trunk/launchd/src/vproc_internal.h


Modified: svn:mergeinfo

/branches/PR-5978442/launchd/src/libvproc_internal.h:23651-23701 /branches/PR-6271234/launchd/src/vproc_internal.h:23818-23822 /branches/PR-6562592/launchd/src/vproc_internal.h:23812-23822 /branches/PR-6564965/launchd/src/vproc_internal.h:23832-23851 /branches/PR-6589133/launchd/src/vproc_internal.h:23810-23822 /branches/PR-6609410/launchd/src/vproc_internal.h:23828 /branches/PR-7178164/launchd/src/vproc_internal.h:23935-23940 + /branches/PR-5898404/launchd/src/libvproc_internal.h:23681-23700 /branches/PR-5978442/launchd/src/libvproc_internal.h:23651-23701 /branches/PR-6271234/launchd/src/vproc_internal.h:23818-23822 /branches/PR-6562592/launchd/src/vproc_internal.h:23812-23822 /branches/PR-6564965/launchd/src/vproc_internal.h:23832-23851 /branches/PR-6589133/launchd/src/vproc_internal.h:23810-23822 /branches/PR-6609410/launchd/src/vproc_internal.h:23828 /branches/PR-7084138/launchd/src/vproc_internal.h:23944-23955 /branches/PR-7178164/launchd/src/vproc_internal.h:23935-23940

Property changes: trunk/launchd/src/vproc_priv.h


Modified: svn:mergeinfo

/branches/PR-5898404/launchd/src/libvproc_private.h:23681-23700 /branches/PR-5978442/launchd/src/libvproc_private.h:23651-23701 /branches/PR-6132016/launchd/src/libvproc_private.h:23719-23738 /branches/PR-6271234/launchd/src/vproc_priv.h:23818-23822 /branches/PR-6562592/launchd/src/vproc_priv.h:23812-23822 /branches/PR-6564965/launchd/src/vproc_priv.h:23832-23851 /branches/PR-6589133/launchd/src/vproc_priv.h:23810-23822 /branches/PR-6609410/launchd/src/vproc_priv.h:23828 /branches/PR-7178164/launchd/src/vproc_priv.h:23935-23940 + /branches/PR-5092682/launchd/src/libvproc_private.h:23731-23742 /branches/PR-5898404/launchd/src/libvproc_private.h:23681-23700 /branches/PR-5978442/launchd/src/libvproc_private.h:23651-23701 /branches/PR-6132016/launchd/src/libvproc_private.h:23719-23738 /branches/PR-6271234/launchd/src/vproc_priv.h:23818-23822 /branches/PR-6562592/launchd/src/vproc_priv.h:23812-23822 /branches/PR-6564965/launchd/src/vproc_priv.h:23832-23851 /branches/PR-6589133/launchd/src/vproc_priv.h:23810-23822 /branches/PR-6609410/launchd/src/vproc_priv.h:23828 /branches/PR-7084138/launchd/src/vproc_priv.h:23944-23955 /branches/PR-7178164/launchd/src/vproc_priv.h:23935-23940