From d3bc8291eb7f87a1a1892a4c32d4fcfa3d986f26 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 8 Jul 1996 01:13:09 +0000 Subject: (S_exec_exec): Don't use unsafe MOVE_SEND in call to interruptible exec_exec stub. --- exec/exec.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/exec/exec.c b/exec/exec.c index a74844e0..a9de454a 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -1745,18 +1745,26 @@ S_exec_exec (struct trivfs_protid *protid, ports_port_deref (protid); } else - err = exec_exec (server, - file, MACH_MSG_TYPE_MOVE_SEND, - oldtask, 0, - argv, argvlen, - envp, envplen, - dtable, MACH_MSG_TYPE_MOVE_SEND, - dtablesize, - portarray, MACH_MSG_TYPE_MOVE_SEND, - nports, - intarray, nints, - deallocnames, ndeallocnames, - destroynames, ndestroynames); + { + int n; + err = exec_exec (server, + file, MACH_MSG_TYPE_COPY_SEND, + oldtask, 0, + argv, argvlen, + envp, envplen, + dtable, MACH_MSG_TYPE_COPY_SEND, + dtablesize, + portarray, MACH_MSG_TYPE_COPY_SEND, + nports, + intarray, nints, + deallocnames, ndeallocnames, + destroynames, ndestroynames); + mach_port_deallocate (mach_task_self (), file); + for (n = 0; n < dtablesize; n++) + mach_port_deallocate (mach_task_self (), dtable[n]); + for (n = 0; n < nports; n++) + mach_port_deallocate (mach_task_self (), portarray[n]); + } mach_port_deallocate (mach_task_self (), server); if (err != ENOEXEC) return err; -- cgit v1.2.3