summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-13 01:23:13 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-13 01:23:13 +0000
commit3c35624ac59808da65f28a0e6338db0d01c57c03 (patch)
tree8d7a105c29697e33d7a3acca77a0cd14d5960ede /exec
parentceded8acfc919def2fe47fc54903bea5f337cfed (diff)
(do_exec): Add code missing from last change.
Diffstat (limited to 'exec')
-rw-r--r--exec/exec.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/exec/exec.c b/exec/exec.c
index 202f708f..f18d5532 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1315,7 +1315,6 @@ do_exec (file_t file,
uid_t euidbuf[10], egidbuf[10], auidbuf[10], agidbuf[10];
uid_t *euids, *egids, *auids, *agids;
size_t neuids, negids, nauids, nagids;
- uid_t uid;
e.error = proc_task2proc (procserver, newtask, &new);
if (e.error)
@@ -1333,10 +1332,25 @@ do_exec (file_t file,
&egids, &negids, &agids, &nagids);
if (e.error)
goto stdout;
-
+
/* Set the owner with the proc server */
e.error = proc_setowner (boot->portarray[INIT_PORT_PROC],
neuids ? euids[0] : 0, !neuids);
+
+ /* Clean up */
+ if (euids != euidbuf)
+ vm_deallocate (mach_task_self (), (vm_address_t) euids,
+ neuids * sizeof (uid_t));
+ if (egids != egidbuf)
+ vm_deallocate (mach_task_self (), (vm_address_t) egids,
+ negids * sizeof (uid_t));
+ if (auids != auidbuf)
+ vm_deallocate (mach_task_self (), (vm_address_t) auids,
+ nauids * sizeof (uid_t));
+ if (agids != agidbuf)
+ vm_deallocate (mach_task_self (), (vm_address_t) agids,
+ nagids * sizeof (uid_t));
+
if (e.error)
goto stdout;
}