summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-11 18:11:18 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-11 18:11:18 +0000
commit7dee55923287d413bddaf57b3be4222784e1d6e0 (patch)
treece5f8b78172689e9a4aab4fbb16744daf63f3a87
parent1e7118e498bb178971478d5c1fb06c86c2098312 (diff)
(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.
-rw-r--r--libfshelp/start-translator-long.c6
1 files changed, 5 insertions, 1 deletions
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;