From 7dee55923287d413bddaf57b3be4222784e1d6e0 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 11 Jul 1995 18:11:18 +0000 Subject: (fshelp_start_translator_long): If PORTS_TYPE is MACH_MSG_TYPE_COPY_SEND, then drop our right on bootstrap after the call, because we are pretending we haven't changed the calling user's state. For the same reason, save the old BOOTSTRAP port value, and restore it after the call. --- libfshelp/start-translator-long.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libfshelp/start-translator-long.c') diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c index 25baa0f2..cfa0319a 100644 --- a/libfshelp/start-translator-long.c +++ b/libfshelp/start-translator-long.c @@ -165,7 +165,7 @@ fshelp_start_translator_long (file_t underlying, { error_t err; file_t executable; - mach_port_t bootstrap, task, prev_notify, proc; + mach_port_t bootstrap, task, prev_notify, proc, saveport; int ports_moved = 0; /* Find the translator itself. Since argz has zero-separated elements, we @@ -212,6 +212,7 @@ fshelp_start_translator_long (file_t underlying, default: abort (); } + saveport = ports[INIT_PORT_BOOTSTRAP]; ports[INIT_PORT_BOOTSTRAP] = bootstrap; /* Try and exec the translator in TASK... */ @@ -220,6 +221,9 @@ fshelp_start_translator_long (file_t underlying, fds, fds_type, fds_len, ports, ports_type, ports_len, ints, ints_len, 0, 0, 0, 0); + if (ports_type == MACH_MSG_TYPE_COPY_SEND) + mach_port_deallocate (mach_task_self (), bootstrap); + ports[INIT_PORT_BOOTSTRAP] = saveport; ports_moved = 1; if (err) goto lose; -- cgit v1.2.3