Changeset 23443
- Timestamp:
- 10/23/07 08:40:55 (14 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 1 added
- 4 modified
-
Makefile.am (modified) (1 diff)
-
Makefile.in (modified) (6 diffs)
-
launchd_core_logic.c (modified) (6 diffs)
-
protocol_job.defs (modified) (2 diffs)
-
protocol_job_forward.defs (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/Makefile.am
r23408 r23443 49 49 launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter 50 50 launchd_LDFLAGS = -lbsm 51 launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c protocol_vprocServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c job_replyUser.c launchd_runtime.c launchd_runtime_kill.c 51 launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c protocol_vprocServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c job_replyUser.c launchd_runtime.c launchd_runtime_kill.c job_forwardUser.c 52 52 53 53 launchd_runtime.c:: notifyServer.h launchd_internal.h 54 launchd_core_logic.c:: protocol_vproc.h job_reply.h protocol_vprocServer.h 54 launchd_core_logic.c:: protocol_vproc.h job_reply.h protocol_vprocServer.h job_forward.h 55 55 56 56 launchproxy_LDFLAGS = -weak_framework Security 57 58 job_forwardUser.c job_forward.h: $(srcdir)/protocol_job_forward.defs 59 mig $(MIGFLAGS) -sheader /dev/null -server /dev/null $(srcdir)/protocol_job_forward.defs 57 60 58 61 notifyServer.c notifyServer.h: /usr/include/mach/notify.defs -
trunk/launchd/src/Makefile.in
r23408 r23443 97 97 launchd_unix_ipc.c protocol_vprocServer.c notifyServer.c \ 98 98 launchd_internalUser.c launchd_internalServer.c \ 99 job_replyUser.c launchd_runtime.c launchd_runtime_kill.c 99 job_replyUser.c launchd_runtime.c launchd_runtime_kill.c \ 100 job_forwardUser.c 100 101 @LIBS_ONLY_FALSE@am_launchd_OBJECTS = launchd-launchd.$(OBJEXT) \ 101 102 @LIBS_ONLY_FALSE@ launchd-launchd_core_logic.$(OBJEXT) \ … … 107 108 @LIBS_ONLY_FALSE@ launchd-job_replyUser.$(OBJEXT) \ 108 109 @LIBS_ONLY_FALSE@ launchd-launchd_runtime.$(OBJEXT) \ 109 @LIBS_ONLY_FALSE@ launchd-launchd_runtime_kill.$(OBJEXT) 110 @LIBS_ONLY_FALSE@ launchd-launchd_runtime_kill.$(OBJEXT) \ 111 @LIBS_ONLY_FALSE@ launchd-job_forwardUser.$(OBJEXT) 110 112 launchd_OBJECTS = $(am_launchd_OBJECTS) 111 113 launchd_LDADD = $(LDADD) … … 254 256 @LIBS_ONLY_FALSE@launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter 255 257 @LIBS_ONLY_FALSE@launchd_LDFLAGS = -lbsm 256 @LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c protocol_vprocServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c job_replyUser.c launchd_runtime.c launchd_runtime_kill.c 258 @LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c protocol_vprocServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c job_replyUser.c launchd_runtime.c launchd_runtime_kill.c job_forwardUser.c 257 259 @LIBS_ONLY_FALSE@launchproxy_LDFLAGS = -weak_framework Security 258 260 @LIBS_ONLY_FALSE@man1_MANS = wait4path.1 launchctl.1 … … 416 418 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SystemStarter-SystemStarter.Po@am__quote@ 417 419 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchctl-launchctl.Po@am__quote@ 420 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-job_forwardUser.Po@am__quote@ 418 421 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-job_replyUser.Po@am__quote@ 419 422 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd.Po@am__quote@ … … 788 791 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 789 792 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_runtime_kill.obj `if test -f 'launchd_runtime_kill.c'; then $(CYGPATH_W) 'launchd_runtime_kill.c'; else $(CYGPATH_W) '$(srcdir)/launchd_runtime_kill.c'; fi` 793 794 launchd-job_forwardUser.o: job_forwardUser.c 795 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-job_forwardUser.o -MD -MP -MF $(DEPDIR)/launchd-job_forwardUser.Tpo -c -o launchd-job_forwardUser.o `test -f 'job_forwardUser.c' || echo '$(srcdir)/'`job_forwardUser.c 796 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/launchd-job_forwardUser.Tpo $(DEPDIR)/launchd-job_forwardUser.Po 797 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='job_forwardUser.c' object='launchd-job_forwardUser.o' libtool=no @AMDEPBACKSLASH@ 798 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 799 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-job_forwardUser.o `test -f 'job_forwardUser.c' || echo '$(srcdir)/'`job_forwardUser.c 800 801 launchd-job_forwardUser.obj: job_forwardUser.c 802 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-job_forwardUser.obj -MD -MP -MF $(DEPDIR)/launchd-job_forwardUser.Tpo -c -o launchd-job_forwardUser.obj `if test -f 'job_forwardUser.c'; then $(CYGPATH_W) 'job_forwardUser.c'; else $(CYGPATH_W) '$(srcdir)/job_forwardUser.c'; fi` 803 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/launchd-job_forwardUser.Tpo $(DEPDIR)/launchd-job_forwardUser.Po 804 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='job_forwardUser.c' object='launchd-job_forwardUser.obj' libtool=no @AMDEPBACKSLASH@ 805 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 806 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-job_forwardUser.obj `if test -f 'job_forwardUser.c'; then $(CYGPATH_W) 'job_forwardUser.c'; else $(CYGPATH_W) '$(srcdir)/job_forwardUser.c'; fi` 790 807 install-man1: $(man1_MANS) $(man_MANS) 791 808 @$(NORMAL_INSTALL) … … 1150 1167 1151 1168 @LIBS_ONLY_FALSE@launchd_runtime.c:: notifyServer.h launchd_internal.h 1152 @LIBS_ONLY_FALSE@launchd_core_logic.c:: protocol_vproc.h job_reply.h protocol_vprocServer.h 1169 @LIBS_ONLY_FALSE@launchd_core_logic.c:: protocol_vproc.h job_reply.h protocol_vprocServer.h job_forward.h 1170 1171 @LIBS_ONLY_FALSE@job_forwardUser.c job_forward.h: $(srcdir)/protocol_job_forward.defs 1172 @LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -sheader /dev/null -server /dev/null $(srcdir)/protocol_job_forward.defs 1153 1173 1154 1174 @LIBS_ONLY_FALSE@notifyServer.c notifyServer.h: /usr/include/mach/notify.defs -
trunk/launchd/src/launchd_core_logic.c
r23439 r23443 92 92 #include "protocol_vprocServer.h" 93 93 #include "job_reply.h" 94 #include "job_forward.h" 94 95 95 96 #define LAUNCHD_MIN_JOB_RUN_TIME 10 … … 5742 5743 5743 5744 kern_return_t 5744 job_mig_look_up2(job_t j, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype, pid_t target_pid, uint64_t flags)5745 job_mig_look_up2(job_t j, mach_port_t srp, name_t servicename, mach_port_t *serviceportp, pid_t target_pid, uint64_t flags) 5745 5746 { 5746 5747 struct machservice *ms; … … 5789 5790 #endif 5790 5791 *serviceportp = machservice_port(ms); 5791 *ptype = MACH_MSG_TYPE_COPY_SEND;5792 5792 kr = BOOTSTRAP_SUCCESS; 5793 5793 } else if (!(flags & BOOTSTRAP_PER_PID_SERVICE) && (inherited_bootstrap_port != MACH_PORT_NULL)) { 5794 5794 job_log(j, LOG_DEBUG, "Mach service lookup forwarded: %s", servicename); 5795 *ptype = MACH_MSG_TYPE_MOVE_SEND; 5796 kr = bootstrap_look_up(inherited_bootstrap_port, servicename, serviceportp); 5795 job_assumes(j, vproc_mig_look_up2_forward(inherited_bootstrap_port, srp, servicename, 0, 0) == 0); 5796 /* The previous routine moved the reply port, we're forced to return MIG_NO_REPLY now */ 5797 return MIG_NO_REPLY; 5797 5798 } else if (getpid() == 1 && j->anonymous && ldc.euid >= 500 && strcasecmp(job_get_bs(j)->name, VPROCMGR_SESSION_LOGINWINDOW) == 0) { 5798 5799 /* … … 5812 5813 5813 5814 kern_return_t 5814 job_mig_parent(job_t j, mach_port_t *parentport, mach_msg_type_name_t *pptype)5815 job_mig_parent(job_t j, mach_port_t srp, mach_port_t *parentport) 5815 5816 { 5816 5817 if (!launchd_assumes(j != NULL)) { … … 5820 5821 job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); 5821 5822 jobmgr_t jm = j->mgr; 5822 5823 *pptype = MACH_MSG_TYPE_MAKE_SEND;5824 5823 5825 5824 if (jobmgr_parent(jm)) { … … 5828 5827 *parentport = jm->jm_port; 5829 5828 } else { 5830 *pptype = MACH_MSG_TYPE_COPY_SEND; 5831 *parentport = inherited_bootstrap_port; 5829 job_assumes(j, vproc_mig_parent_forward(inherited_bootstrap_port, srp) == 0); 5830 /* The previous routine moved the reply port, we're forced to return MIG_NO_REPLY now */ 5831 return MIG_NO_REPLY; 5832 5832 } 5833 5833 return BOOTSTRAP_SUCCESS; -
trunk/launchd/src/protocol_job.defs
r23343 r23443 64 64 routine look_up2( 65 65 __bs_port : job_t; 66 sreplyport __rport : mach_port_make_send_once_t; 66 67 __service_name : name_t; 67 out __service_port : mach_port_ send_t;68 out __service_port : mach_port_t; 68 69 __target_pid : pid_t; 69 70 __flags : uint64_t); … … 77 78 routine parent( 78 79 __bs_port : job_t; 79 out __parent_port : mach_port_send_t); 80 sreplyport __rport : mach_port_make_send_once_t; 81 out __parent_port : mach_port_make_send_t); 80 82 81 83 routine post_fork_ping(

